Click here to Skip to main content
15,920,602 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Web Service Help Pin
Dave Kreskowiak6-Aug-04 7:16
mveDave Kreskowiak6-Aug-04 7:16 
GeneralVBtab not working in a label in VB.NET Pin
dotnetfriend6-Aug-04 5:46
dotnetfriend6-Aug-04 5:46 
GeneralRe: VBtab not working in a label in VB.NET Pin
Dave Kreskowiak6-Aug-04 7:03
mveDave Kreskowiak6-Aug-04 7:03 
GeneralByReference help Pin
Anonymous6-Aug-04 4:20
Anonymous6-Aug-04 4:20 
GeneralRe: ByReference help Pin
Dave Kreskowiak6-Aug-04 5:39
mveDave Kreskowiak6-Aug-04 5:39 
GeneralRe: ByReference help Pin
Anonymous6-Aug-04 6:03
Anonymous6-Aug-04 6:03 
GeneralRe: ByReference help Pin
Dave Kreskowiak6-Aug-04 6:40
mveDave Kreskowiak6-Aug-04 6:40 
GeneralRe: ByReference help Pin
Dave Kreskowiak6-Aug-04 6:52
mveDave Kreskowiak6-Aug-04 6:52 
Actually, there is a method to do it using ByRef, but it's not flexible. You must pass all of your variables in AND use the same number of parameters. But...

In your dialog class, you would create a Sub that takes parameters for all of the fields you want to return from your form. This Sub would call ShowDialog on itself. When the user clicks OK, the Sub would then pull off all the fields and assign them, one by one, to the parameters passed in. So if you want to pull off the values of 15 fields when the user clicks OK, your function would look something like this:.
Public Sub MyShowDialog(ByRef field1 As String, ByRef field2 As String, ByRef field3 As Integer, ... )
    If Me.ShowDialog() = DialogResult.OK Then          ' This is a blocking call so nothing will execute until this returns
        field1 = WhateverControl.Text()
        field2 = WhateverOtherControl1.Text()
        field3 = WhateverOtherControl2.Text()
        ...
        ...
    End If
End Sub

Now, when you call the MyShowDialog from your other form:
    Dim myData1 As String
    Dim myData2 As String
    Dim myData3 As Integer
    ...
    ...
 
    myDialog.MyShowDialog( myData1, myData2, myData3, ... )
    ' Now all your variable have their values...

Remember this though, I said it's possible, to do it this way. It is NOT the best way to pull values off of a form.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: ByReference help Pin
Anonymous6-Aug-04 7:29
Anonymous6-Aug-04 7:29 
GeneralRe: ByReference help Pin
Dave Kreskowiak6-Aug-04 8:02
mveDave Kreskowiak6-Aug-04 8:02 
GeneralRe: ByReference help Pin
normanordas10-Aug-04 21:49
normanordas10-Aug-04 21:49 
GeneralNeed more helps at datagrid button column Pin
Lisana6-Aug-04 4:15
Lisana6-Aug-04 4:15 
GeneralGood book on Win32 API calls Pin
Simon Kearn6-Aug-04 1:07
sussSimon Kearn6-Aug-04 1:07 
GeneralRe: Good book on Win32 API calls Pin
Michael P Butler6-Aug-04 1:43
Michael P Butler6-Aug-04 1:43 
GeneralRe: Good book on Win32 API calls Pin
Duncan Edwards Jones6-Aug-04 2:11
professionalDuncan Edwards Jones6-Aug-04 2:11 
GeneralRe: Good book on Win32 API calls Pin
Nick Seng8-Aug-04 16:17
Nick Seng8-Aug-04 16:17 
GeneralMouse Enter, Mouse Leave Pin
RWWB6-Aug-04 0:48
RWWB6-Aug-04 0:48 
GeneralRe: Mouse Enter, Mouse Leave Pin
Jim Matthews6-Aug-04 2:52
Jim Matthews6-Aug-04 2:52 
Generaluse c++ dll in VB6 application Pin
sumiko6-Aug-04 0:10
sumiko6-Aug-04 0:10 
GeneralRe: use c++ dll in VB6 application Pin
Michael P Butler6-Aug-04 1:01
Michael P Butler6-Aug-04 1:01 
GeneralRe: use c++ dll in VB6 application Pin
Dave Kreskowiak6-Aug-04 3:04
mveDave Kreskowiak6-Aug-04 3:04 
Generalcommunication with I2C Adapter Pin
sumiko5-Aug-04 21:11
sumiko5-Aug-04 21:11 
GeneralRe: communication with I2C Adapter Pin
Dave Kreskowiak6-Aug-04 3:00
mveDave Kreskowiak6-Aug-04 3:00 
GeneralRe: communication with I2C Adapter Pin
sumiko10-Aug-04 20:43
sumiko10-Aug-04 20:43 
GeneralRe: communication with I2C Adapter Pin
Dave Kreskowiak11-Aug-04 1:15
mveDave Kreskowiak11-Aug-04 1:15 

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.