Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

In other i have written a module called 'Logout', now to call 'Logout', you type,

 

logout (string, integer)

 

and it passes the string and integer into the module from whatever module was calling it.

 

Can i do the same with form, just as?

 

newform.showdialog(integer)

 

If so could you please tell me how?

  • Administrators
Posted

You could provide your own .ShowDialog Method in your own form and accept a parameter - then just call the real ShowDialog

 

in your form add something like

 Public Overloads Sub ShowDialog(ByVal i As Integer)
       'Do something with i here
       ShowDialog()

   End Sub

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

  • *Experts*
Posted
You'll need to either change the constructor, or make a new ShowDialog function:
'in the Form
Public Sub New(ByVal param As Integer)
 'store "param" in a private member for later use
 MyBase.New
End Sub

'when you create it:
Dim newform As New Form1(55)

OR

'in the form:
Public Overloads Sub ShowDialog(ByVal param As Integer)
   MyBase.ShowDialog()
    'store param for later user
End Sub

'when you show it:
newform.ShowDialog(55)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...