473,395 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Weird VB .Net Question

Hi,

I am trying to do something that should be EASY but is not working for
me for some reason.

My application opens to a Main form, similar to a SwitchBoard in Access.
What I am trying to do, and I may not be doing the best thing, is hide
the Main form, and open whatever form the user is trying to use. This
works fine with the following sample code:

Dim Second As New Form2()

Me.Hide()
Second.Show()

My problem is closing form2 and reopening the Main form. I tried using
code like this:

Dim first As Form1

first.Activate()
Me.Close()

Nothing I try works. Tee second form closes, but the first one never
shows. I have tried doing the second form code like the one I used from
the Main form, but nothing works.

HELP!

Randy

Nov 20 '05 #1
2 937
Using the Show() method runs asynchronously as opposed to its synchronous
counterpart ShowDialog()

In order to get what you want to work you have to know that the form 2 is
closing. However, with your method, it is only possible that one form be
open at a time treeing of the first form..

So instead...

Private sub Button_Click(sender as object, e as system.eventargs) handles
button.click

dim frm2 as new Form2

me.hide()
frm2.Showdialog()
me.show()
frm2 = nothing

end sub

"Randy" <ra***@webtracersolutions.com> wrote in message
news:10*************@corp.supernews.com...
Hi,

I am trying to do something that should be EASY but is not working for
me for some reason.

My application opens to a Main form, similar to a SwitchBoard in Access.
What I am trying to do, and I may not be doing the best thing, is hide
the Main form, and open whatever form the user is trying to use. This
works fine with the following sample code:

Dim Second As New Form2()

Me.Hide()
Second.Show()

My problem is closing form2 and reopening the Main form. I tried using
code like this:

Dim first As Form1

first.Activate()
Me.Close()

Nothing I try works. Tee second form closes, but the first one never
shows. I have tried doing the second form code like the one I used from
the Main form, but nothing works.

HELP!

Randy

Nov 20 '05 #2
* Randy <ra***@webtracersolutions.com> scripsit:
My application opens to a Main form, similar to a SwitchBoard in
Access. What I am trying to do, and I may not be doing the best thing,
is hide the Main form, and open whatever form the user is trying to
use. This works fine with the following sample code:


<http://www.google.de/groups?selm=%23pYfDaV6CHA.1676%40TK2MSFTNGP12.phx. gbl>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet/>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Robert Schott | last post by:
Hi .. this is for sure the 1k question on fopen but maybe can someone tell me this weird staff if i'm writing: $H = fopen($value,"r"); while(!feof($H)) { $string = fgets($H,1024); .... .......
1
by: Jim Dawson | last post by:
I was writing a subroutine to extract fields from lines of text when I ran into an issue. I have reproduced this error on Perl 5.8 on AIX, 5.8 on Linux and 5.6 on Windows. ############### CUT...
2
by: holgeradelmann | last post by:
Can anyone help please: I found a nice article on the web how to write my dynamice information into an RSS-XML. But I cannot get the code to work. The problem is so simple but weird....
1
by: Pelle | last post by:
Hello all, I have to admit, that the idea that occurred to me recently is weird. It was somehow inspired by the huge response on the "delete operator" thread, but goes into a somewhat different...
82
by: nobody | last post by:
Howdy, Mike! mikecoxlinux@yahoo.com (Mike Cox) wrote in message news:<3d6111f1.0402271647.c20aea3@posting.google.com>... > I'm a C++ programmer, and have to use lisp because I want to use >...
5
by: John Kiernan | last post by:
Hey JavaScript gurus! Here's a weird one: If I check (with an alert) this line: vStrDate2 = vDate.toLocaleString(); I get: Saturday, August 14, 2004 7:57:30 PM (as I should) but this...
0
by: Greenwich Support | last post by:
Hi All, I have a very weird problem which is occurring with a VB.Net app and PostgreSQL 7.3.1. There is a form that has a standard .Net datagrid on it that contains some data from a table in...
5
by: marcmc | last post by:
Is it in any way possible to have a sProc called and executed within SQLServer return its return value to an open .Net Vb application? As a programmer I beleive this can be done and if I wreck my...
2
by: carlos123 | last post by:
im pretty new to java. this might sound like a weird question but! how do i add this code class FileWrite { public static void main(String args) { try{ // Create file ...
2
by: Drupan c | last post by:
Hello everybody i have a weird question... if u guys have observed when we use ms sql .. on the query box when we take the mouse pointer to the corner of a single line...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.