Home | Index | Dotnet4all Snippets | Submit resources
About | Mail us 





How to find Dialog (Tuesday, February 01, 2005)



Found the following interesting discussion in the Newsgroups:

Find Dialog
by:Anonymous

I'm trying to create a find dialog box and I need to understand this part of .NET (I am an experienced vb6 programmer):
- How do i create a variable that can be accessed and modified on two forms? I tried public variables in a module, but they didn't seem to work.
- How can I do something like (in vb6) frmMain.txtMain.Text = "HI" . I have searched and searched an I can't understand how to do this!

Thank you!



 Reply:
by:Cor Ligthert

 Hi Newto,

> I'm trying to create a find dialog box and I need to understand this part
of .NET (I am an experienced vb6 programmer):

Make a form and than you can use
dim frmdialog as new form2
myvars.myproperty = something 'see below
frmdialog.showdialog (you can also test the return value with this)
frmdialog.dispose

And on Form2 in the load event when you use it as above
mytextbox.text = myvars.myproperty

> - How do i create a variable that can be accessed and modified on two
forms? I tried public variables in a module, but they didn't seem to work.
The above method should work, however the nicest way is
\\public class myvars
Private Shared mVar As String
Public Shared Property myproperty() As String
Get
Return (mVar)
End Get
Set(ByVal Value As String)
mVar = Value
End Set
End Property
End Class
///

> - How can I do something like (in vb6) frmMain.txtMain.Text = "HI" . I
have searched and searched an I can't understand how to do this!

And than the easy one
me.text = "HI"

I hope this helps?

Cor



Posted by Xander Zelders



0 Comments:

Post a Comment

<< Home

 
Previous Posts
    - Odd Format issue
    - Can't FindControl in DataGrid
    - How to compare IntPtr's
    - exhausted all avenues
    - How to load Help File in VB.NET
    - VB.NET DLLs and ProgIDs
    - How to copy selected items in listbox to windows c...
    - How to navigate the records and binding it to text...
    - How to change design in excel from VB.NET
    - CommandBuilder.Dispose - should I use it?



Disclaimer & Terms of Use | DotNet4All.Com concept & © 2004 - 2007 by Zelders² - Holland