Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to pass variables to a new form? Pin
Emmet_Brown10-Nov-09 6:04
Emmet_Brown10-Nov-09 6:04 
GeneralRe: How to pass variables to a new form? Pin
Md. Marufuzzaman10-Nov-09 6:15
professionalMd. Marufuzzaman10-Nov-09 6:15 
GeneralRe: How to pass variables to a new form? Pin
dan!sh 10-Nov-09 6:30
professional dan!sh 10-Nov-09 6:30 
AnswerRe: How to pass variables to a new form? Pin
Shameel10-Nov-09 7:30
professionalShameel10-Nov-09 7:30 
GeneralRe: How to pass variables to a new form? Pin
Not Active10-Nov-09 9:01
mentorNot Active10-Nov-09 9:01 
GeneralRe: How to pass variables to a new form? Pin
Shameel11-Nov-09 7:57
professionalShameel11-Nov-09 7:57 
GeneralRe: How to pass variables to a new form? Pin
Not Active11-Nov-09 8:03
mentorNot Active11-Nov-09 8:03 
AnswerRe: How to pass variables to a new form? Pin
_Maxxx_10-Nov-09 20:04
professional_Maxxx_10-Nov-09 20:04 
SelectedObject = GetSelectedObjectFromListBox();<br />
MyPopUpForm form = new MyPopUpForm();<br />
form.SelectedObject = SelectedObject;<br />
form.Show();


or

SelectedObject = GetSelectedObjectFromListBox();<br />
MyPopUpForm form = new MyPopUpForm(SelectedObject );<br />
form.Show();


depending on your preference.

In the 1st case you need a public property in your popup form, called SelectedObject. In the setter, you need to do what you need to do.

In the 2nd case you need a constructor that takes a SelectedObject as a parameter. It is usually inadvisable to use this constructor to populate your form - store it then populate when the form is shown.

___________________________________________
.\\axxx
(That's an 'M')

QuestionHow to check if windows feature is installed Pin
Planker10-Nov-09 4:52
Planker10-Nov-09 4:52 
Questioncheckbox Pin
farokhian10-Nov-09 3:52
farokhian10-Nov-09 3:52 
AnswerRe: checkbox Pin
EliottA10-Nov-09 4:02
EliottA10-Nov-09 4:02 
GeneralRe: checkbox Pin
farokhian10-Nov-09 4:05
farokhian10-Nov-09 4:05 
GeneralRe: checkbox Pin
EliottA10-Nov-09 4:09
EliottA10-Nov-09 4:09 
AnswerRe: checkbox Pin
Shameel10-Nov-09 4:47
professionalShameel10-Nov-09 4:47 
GeneralRe: checkbox Pin
farokhian10-Nov-09 4:49
farokhian10-Nov-09 4:49 
GeneralRe: checkbox Pin
EliottA10-Nov-09 4:58
EliottA10-Nov-09 4:58 
GeneralRe: checkbox Pin
Md. Marufuzzaman10-Nov-09 5:48
professionalMd. Marufuzzaman10-Nov-09 5:48 
AnswerRe: checkbox Pin
Christian Graus10-Nov-09 8:56
protectorChristian Graus10-Nov-09 8:56 
GeneralRe: checkbox Pin
EliottA11-Nov-09 8:48
EliottA11-Nov-09 8:48 
QuestionGraphics in C# versus Graphics in Java Pin
dbstudio10-Nov-09 3:41
dbstudio10-Nov-09 3:41 
AnswerRe: Graphics in C# versus Graphics in Java Pin
Christian Graus10-Nov-09 8:59
protectorChristian Graus10-Nov-09 8:59 
Questionclearing up oledb command Pin
Chazzysb10-Nov-09 2:54
Chazzysb10-Nov-09 2:54 
AnswerRe: clearing up oledb command Pin
PIEBALDconsult10-Nov-09 2:59
mvePIEBALDconsult10-Nov-09 2:59 
GeneralRe: clearing up oledb command Pin
Chazzysb10-Nov-09 3:01
Chazzysb10-Nov-09 3:01 
GeneralRe: clearing up oledb command Pin
PIEBALDconsult10-Nov-09 4:13
mvePIEBALDconsult10-Nov-09 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.