Click here to Skip to main content
15,911,785 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSYSTEM DIR. Pin
msleem30-Sep-06 13:42
msleem30-Sep-06 13:42 
AnswerRe: SYSTEM DIR. Pin
Dave Kreskowiak1-Oct-06 14:27
mveDave Kreskowiak1-Oct-06 14:27 
Questionreading data from a dataset [modified] Pin
jon-8030-Sep-06 7:51
professionaljon-8030-Sep-06 7:51 
AnswerRe: reading data from a dataset Pin
freefika30-Sep-06 9:53
freefika30-Sep-06 9:53 
QuestionForm1 And Form2 Pin
Xmen Real 30-Sep-06 7:27
professional Xmen Real 30-Sep-06 7:27 
AnswerRe: Form1 And Form2 Pin
Christian Graus30-Sep-06 11:44
protectorChristian Graus30-Sep-06 11:44 
GeneralRe: Form1 And Form2 Pin
Xmen Real 30-Sep-06 16:51
professional Xmen Real 30-Sep-06 16:51 
GeneralRe: Form1 And Form2 Pin
darkelv30-Sep-06 19:50
darkelv30-Sep-06 19:50 
The problem is it's too easy on vb6. Smile | :)

Another way to do it is form2 return some values and a flag to indicate whether the values from forms 2 is valid, to whichever form that call form2.

Form2
Has public property of ReturnValue, which set some value depending on user action (drop down selected index changed, text box etc)
Has boolean flag IsValid to indicate the ReturnValue is valid (in case user didn't select anything, yada, yada)
On Form2 OK button, set DialogResult to DialogResult.OK
Validate return value, if validate OK, set IsValid to true else false.
Close Form2.

On Form1 button event
new Form2 and Show(), and save Form2 DialogResult
check Form2 DialogResult, if it is DialogResult.OK, check IsValid, if IsValid is true, take value from ReturnValue and put in Form1.TextBox.Text.

Passing Values Between Forms
GeneralRe: Form1 And Form2 [modified] Pin
Xmen Real 30-Sep-06 22:58
professional Xmen Real 30-Sep-06 22:58 
GeneralRe: Form1 And Form2 Pin
Christian Graus1-Oct-06 9:34
protectorChristian Graus1-Oct-06 9:34 
GeneralRe: Form1 And Form2 Pin
Christian Graus1-Oct-06 9:42
protectorChristian Graus1-Oct-06 9:42 
GeneralRe: Form1 And Form2 Pin
Xmen Real 1-Oct-06 19:55
professional Xmen Real 1-Oct-06 19:55 
GeneralRe: Form1 And Form2 Pin
Christian Graus1-Oct-06 21:34
protectorChristian Graus1-Oct-06 21:34 
GeneralRe: Form1 And Form2 Pin
Xmen Real 1-Oct-06 21:55
professional Xmen Real 1-Oct-06 21:55 
GeneralRe: Form1 And Form2 Pin
Christian Graus1-Oct-06 22:05
protectorChristian Graus1-Oct-06 22:05 
GeneralRe: Form1 And Form2 Pin
Xmen Real 1-Oct-06 23:19
professional Xmen Real 1-Oct-06 23:19 
GeneralRe: Form1 And Form2 Pin
Christian Graus1-Oct-06 23:28
protectorChristian Graus1-Oct-06 23:28 
GeneralRe: Form1 And Form2 Pin
Xmen Real 2-Oct-06 4:34
professional Xmen Real 2-Oct-06 4:34 
GeneralRe: Form1 And Form2 Pin
Xmen Real 2-Oct-06 9:03
professional Xmen Real 2-Oct-06 9:03 
GeneralRe: Form1 And Form2 Pin
Christian Graus2-Oct-06 9:15
protectorChristian Graus2-Oct-06 9:15 
QuestionPublishing website and making it show [modified] Pin
§tring§urfer30-Sep-06 5:35
§tring§urfer30-Sep-06 5:35 
AnswerRe: Publishing website and making it show Pin
Christian Graus30-Sep-06 11:52
protectorChristian Graus30-Sep-06 11:52 
GeneralRe: Publishing website and making it show Pin
§tring§urfer30-Sep-06 13:32
§tring§urfer30-Sep-06 13:32 
GeneralRe: Publishing website and making it show Pin
Christian Graus1-Oct-06 9:37
protectorChristian Graus1-Oct-06 9:37 
GeneralRe: Publishing website and making it show Pin
§tring§urfer10-Oct-06 10:49
§tring§urfer10-Oct-06 10:49 

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.