|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need help re: vb.net windows formsIn my prject I have three forms:
frmMenu.vb frmReherse.vb frmWriteFile.vb frmMenu.vb is my startup object. How do I call frmReherse.vb from frmMenu.vb? Thanks, Howard Hello!
I think you should simply show the form. Sub a() frmReherse.Show() End Sub jax1***@yahoo.com wrote: Show quoteHide quote > In my prject I have three forms: > > frmMenu.vb > frmReherse.vb > frmWriteFile.vb > > frmMenu.vb is my startup object. How do I call frmReherse.vb from > frmMenu.vb? > > Thanks, > Howard There are a few different ways. First, we need to know the class names of
each file. I will assume that your classes are called FrmMenu, FrmReherse, and so on. The easiest way to display another form is to use its Show() or ShowDialog() method from the My.Forms collection. My.Forms.FrmReherse.ShowDialog() Or you can use the shortcut for this statement: FrmReherse.ShowDialog() ShowDialog() opens the form "modally," which makes it the sole focus of your application (in general). Using Show() instead opens the form, but allows the user to switch to other open forms at any time. A second method is to create a specific instance of the second form, and open that. Dim otherForm As FrmReherse .... otherForm = New FrmReherse otherForm.ShowDialog() ----- Tim Patrick Start-to-Finish Visual Basic 2005 Show quoteHide quote > In my prject I have three forms: > > frmMenu.vb > frmReherse.vb > frmWriteFile.vb > frmMenu.vb is my startup object. How do I call frmReherse.vb from > frmMenu.vb? > > Thanks, > Howard On Mon, 23 Oct 2006 10:12:47 -0400, jax1***@yahoo.com wrote:
>In my prject I have three forms: Dim otherForm As frmReherse> >frmMenu.vb >frmReherse.vb >frmWriteFile.vb > >frmMenu.vb is my startup object. How do I call frmReherse.vb from >frmMenu.vb? > >Thanks, >Howard otherForm = New frmReherse otherForm.ShowDialog() worked !!!! thanks FrmReherse.ShowDialog() got and error message: reference to a non-shared member requires an object reference If you are building a non-Windows-Forms application, the statement that failed
will certainly fail because My.Forms is not configured. My.Forms only appears if you create a true Windows application. I assume that you are creating a DLL or a User Control. In that case, just use the version that worked. ----- Tim Patrick Start-to-Finish Visual Basic 2005 Show quoteHide quote > On Mon, 23 Oct 2006 10:12:47 -0400, jax1***@yahoo.com wrote: > >> In my prject I have three forms: >> >> frmMenu.vb >> frmReherse.vb >> frmWriteFile.vb >> frmMenu.vb is my startup object. How do I call frmReherse.vb from >> frmMenu.vb? >> >> Thanks, >> Howard > Dim otherForm As frmReherse > otherForm = New frmReherse > otherForm.ShowDialog() > worked !!!! thanks > > FrmReherse.ShowDialog() > > got and error message: reference to a non-shared member requires an > object reference > > Dim otherForm As frmReherse You could also "one line it" and use> otherForm = New frmReherse Dim otherForm as New frmReherse() or even Dim otherForm as frmReherse = New frmReherse() It doesn't really matter which you use, it's mainly just personal preference. I tend to believe it makes the code easier to read if you just use one line to declare/instatiate a variable. Thanks, Seth Rowe jax1***@yahoo.com wrote: Show quoteHide quote > On Mon, 23 Oct 2006 10:12:47 -0400, jax1***@yahoo.com wrote: > > >In my prject I have three forms: > > > >frmMenu.vb > >frmReherse.vb > >frmWriteFile.vb > > > >frmMenu.vb is my startup object. How do I call frmReherse.vb from > >frmMenu.vb? > > > >Thanks, > >Howard > > > Dim otherForm As frmReherse > otherForm = New frmReherse > otherForm.ShowDialog() > > worked !!!! thanks > > > FrmReherse.ShowDialog() > > got and error message: reference to a non-shared member requires an > object reference
How to receive an array of doubles using VB from a C DLL
Question about rounding the decimal Controlling how Excel starts when using VB.Net Automation Having problems with SetWindowText api DataView Question What are the strings that define a connection's server version? Setting Null value in SQL update statement Event firing order [Newbie] How can I do that ? Archive? |
|||||||||||||||||||||||