Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make NumericUpDown a dialog? 1

Status
Not open for further replies.

mheppler

Programmer
Feb 6, 2006
8
0
0
US
I am unable to get my NumericUpDown off my form when the program is running. I started by dragging the NUD from the toolbox. Then I set the AccessiblityRole to Dialog. I've messed around with .BringToFront, .Visible, .Focus, .Show, .Enabled and it still appears on the Form1. I would like it to float "free" like I see all the time in real life. Thanks and thanks for previous answers, Mark
 
I think this was addressed earlier. By setting the AccessibilityRole property - you do not turn it into a dialog.

You have to create your dialog manually

Right click on your project and select "Add New Windows Form"

Call your new form NUDForm

Add your numericupdown to the form.

Go to the code of your form and add this

Code:
public int NUDValue
{
     get
     {
         return numericUpDown1.Value;
     }
     set
     {
        numericUpDown1.Value = value;
     }
}

when you want to show the form you say

Code:
NUDForm dlgNUDForm = new NUDForm;

dlgNUDForm.Show();

int nudvalue = dlgNUDForm.NUDValue;


That should get you started
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top