|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Instance of the formI am trying to call instance of the form from code.
So I have forms frm1, frm2, frm3 I can open them: frm1.definstance.show, frm2.definstance.show... I want to create something like this: sub openform(formname) formname.definstance.show end sub I don't know what is formname here, dim formname as ?? I hope I explained that. Cheers Schapopa *** Sent via Developersdex http://www.developersdex.com *** I hope i understud your question right...
here an examplecode not using name but the instance istself: Public Class Class1 Private F1 As New Form1 Private F2 As New Form2 Private F3 As New Form3 ' you may simple call the instances to do what you expect Public Sub Main() F1.Show() F2.Show() F3.Show() End Sub ' or handling this calling for some other reasons with a special method Public Sub Doit() OpenForm(F1) OpenForm(F2) OpenForm(F3) End Sub Public Sub OpenForm(ByVal instance As System.Windows.Forms.Form) ' .... instance.Show() ' .... End Sub End Class if this is a much to simple interpretation for your case - try it with the CallByName method... -- Show quoteHide quotePG "schapopa" wrote: > I am trying to call instance of the form from code. > So I have forms frm1, frm2, frm3 > I can open them: frm1.definstance.show, frm2.definstance.show... > I want to create something like this: > > sub openform(formname) > formname.definstance.show > end sub > > I don't know what is formname here, > dim formname as ?? > I hope I explained that. > Cheers > Schapopa > > *** Sent via Developersdex http://www.developersdex.com *** >
Countdown
is there a control that displays a multi-column array of rectangles Is This Overkill? Talking with USB GPS in VB.Net Listing properties of an object Checking db connection open status File busy after sent via email Problem on shutdown computer if my appication is opened Write to an Access database Help Converting Some C# Code to Visual Basic... |
|||||||||||||||||||||||