473,473 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Big InputBox

I need to emulate an input box that is about 3 lines
taller then the normal. My prompt is running under the
text box! So I made my own InputBox windows form.

I want to call my form just like you would an inputbox.
The problem I am facing is returning the user input after
they click the OK button.

Any examples would be greatly appreciated.

TIA,
Graham
Jul 21 '05 #1
2 1797
Declare a Property for each piece of information you want to have returned.

Then, after calling showdialog, check if DialogResult.OK and if so, then get
each of the forms properties. On the form, behind the OK button's click
event, set the properties. When the Dialog is returned after that, the
calling form will have acccess to each of the properties
frmDialog f = new frmDialog();
switch(f.ShowDialog()){
case: DialogResult.Ok
myVariable1 = f.FirstProperty;
break;
myVariable2 = f.SecondProperty;
break;

}

then, behind the ok button of the Dialog form
this.FirstProperty = textBox1.text;
this.SecondProperty = textBox2.text;

HTH,

Bill
"Graham" <sy******@hotmail.com> wrote in message
news:00****************************@phx.gbl...
I need to emulate an input box that is about 3 lines
taller then the normal. My prompt is running under the
text box! So I made my own InputBox windows form.

I want to call my form just like you would an inputbox.
The problem I am facing is returning the user input after
they click the OK button.

Any examples would be greatly appreciated.

TIA,
Graham

Jul 21 '05 #2
Declare a Property for each piece of information you want to have returned.

Then, after calling showdialog, check if DialogResult.OK and if so, then get
each of the forms properties. On the form, behind the OK button's click
event, set the properties. When the Dialog is returned after that, the
calling form will have acccess to each of the properties
frmDialog f = new frmDialog();
switch(f.ShowDialog()){
case: DialogResult.Ok
myVariable1 = f.FirstProperty;
break;
myVariable2 = f.SecondProperty;
break;

}

then, behind the ok button of the Dialog form
this.FirstProperty = textBox1.text;
this.SecondProperty = textBox2.text;

HTH,

Bill
"Graham" <sy******@hotmail.com> wrote in message
news:00****************************@phx.gbl...
I need to emulate an input box that is about 3 lines
taller then the normal. My prompt is running under the
text box! So I made my own InputBox windows form.

I want to call my form just like you would an inputbox.
The problem I am facing is returning the user input after
they click the OK button.

Any examples would be greatly appreciated.

TIA,
Graham

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: news.microsoft.com | last post by:
hey all, I am having an odd problem with the InputBox in VB.NET, and it ONLY happens on one of my computers. When I try "Dim x as String = InputBox("TESTPROMPT"), I get the following error: ...
2
by: missimaths | last post by:
I was wondering if anyone knew of a way to control the text a user types into an inputbox? I want the user to type in four letters only. I can check the lenght by using the len() function in vba...
1
by: Hans Kamp | last post by:
How do I use InputBox? private void addButton_Click(object sender, System.EventArgs e) { string newName; newName = InputBox("t1", "t2", "t3"); namesListBox.Items.Add(newName); }
1
by: | last post by:
When trying to use the InputBox function I get the error "InputBox is a namespace and therefore is not a valid expression". Can anyone tell me what the problem is? Thanks.
7
by: portroe | last post by:
How can you populate an array using an inputbox(es)? thanks portroe
3
by: jcrouse | last post by:
Here is my code: Private Sub cmP1JoyUpLabelSize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmP1JoyUpLabelSize.Click lblP1JoyUp.Width = InputBox("Enter the Width of...
8
by: about:mozilla | last post by:
I'm just a newbie in vb.net and I have this terrible problem. I want to use inputbox to get number. -User can give numbers starting from 0 -If cancel is pressed then default number stays -If text...
2
by: MLH | last post by:
HowManyMore = InputBox(MyString, "How Many More?", "3") The above line results in an InputBox displaying that has an X button in the upper right corner. And next to it, there's a ? button (for...
8
by: jpoquette | last post by:
I have recently upgraded a Visual Basic 2003 win forms application to 2005. After doing so I can no longer get my project to compile. The code is bombing on any line that uses an InputBox. I'm...
0
by: insight_find | last post by:
I would like to check the user input into an inputbox in vb.net 2003. The inputbox in my program assigns the input from the inputbox into an array called get_grades which takes in students grades...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.