InputBox

D

davebythesea

Hi folks,

I'm trying to create an input box which can be used to collect some text
data from a user. I'm looking for something like the MessageBox, with an OK
and Cancel button, and a multiline TextBox with a vertical scroll bar. I've
created new UserControl and inherited from the Form class. In the design view
I then shrunk the Form size down and added the buttons and textbox.

However, when I go to create an instance of this control in my application,
and call the ShowDialog() method, the Form does indeed show but it is the
size of an ordinary form and fills the whole screen. I just want to display
the inputbox so it will hover over the parent form and not take up the whole
screen.

I tried setting the Width and Height properties once I create the instance
but it has no effect.

Any ideas if this is possible?

Thanks once again,
Dave

PS - here is a little code

// My UserControl class, not much changed
public partial class WMInputBox : Form
{
public WMInputBox()
{
InitializeComponent();

this.Width = 200;
this.Height = 100;
}
}

// Using the control
WMControls.WMInputBox i = new Mobile.WMControls.WMInputBox();

i.Width = 200;
i.Height = 100;

i.WindowState = FormWindowState.Normal;

i.ShowDialog();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top