473,398 Members | 2,380 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,398 software developers and data experts.

vb-> form1.show

VS2003

if i say

dim form1 as new form1
form1.show()

It opens a new form everytime...

But....what if....
"form1" opened.....
then I told it to hide, using me.hide()....
how would i show it again?
Wouldnt "as new" open a new form1? instead of showing the one thats hidden?

If i write:

form1.show()

that generates errors (refrence to a non-shared member requires an object
refrence)...

So how would i show a hidden form

Nov 21 '05 #1
2 3092

"Hareth" <ab******@hotmail.com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
VS2003

if i say

dim form1 as new form1
form1.show()

It opens a new form everytime...
Of course it does. You're initializing a 'new' object every time.
But....what if....
"form1" opened.....
then I told it to hide, using me.hide()....
how would i show it again?
Wouldnt "as new" open a new form1? instead of showing the one thats
hidden?

If i write:

form1.show()

that generates errors (refrence to a non-shared member requires an object
refrence)...

So how would i show a hidden form


in Form1, add the following

Public Shared myForm as Form1

Then, in the Form1_Load event:
myForm = Me

In other forms, you can access that instance of form1 by calling:
Form1.myForm.<whatever>

HTH,

-Jason
Nov 21 '05 #2
Xlnt!!!!.....
"OpticTygre" <op********@adelphia.net> wrote in message
news:l9********************@adelphia.com...

"Hareth" <ab******@hotmail.com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
VS2003

if i say

dim form1 as new form1
form1.show()

It opens a new form everytime...


Of course it does. You're initializing a 'new' object every time.

But....what if....
"form1" opened.....
then I told it to hide, using me.hide()....
how would i show it again?
Wouldnt "as new" open a new form1? instead of showing the one thats
hidden?

If i write:

form1.show()

that generates errors (refrence to a non-shared member requires an object
refrence)...

So how would i show a hidden form


in Form1, add the following

Public Shared myForm as Form1

Then, in the Form1_Load event:
myForm = Me

In other forms, you can access that instance of form1 by calling:
Form1.myForm.<whatever>

HTH,

-Jason

Nov 21 '05 #3

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

Similar topics

16
by: Terry | last post by:
Hi, I need some feedback. We are converting to .Net and we are trying to decide on whether to use VB.net or C#.net. As far as our current systems, they will probably be rewritten in ASP.Net. I...
7
by: Simon Peng | last post by:
-- ---------------- Simon Peng xqpeng@tsinghua.org.cn
5
by: Saga | last post by:
Hi all, I just read the thread by the same name posted on Jun 15, 9:45 AM, but I am looking at it from a different point of view. I came across this question in terms of functionality. Are VB and...
13
by: Arsalan | last post by:
Is there any advantage in C# over VB.NET ? Or the difference is only syntax ? Can anything done in C# which cannot be done in VB.NET?
72
by: Robin Tucker | last post by:
I need to find some documents/research for my manager about VB.NET v C# use. I've noticed that there are many more people using C# than VB.NET, that there seem to be more job vacancies specifying...
28
by: Andy | last post by:
Any good resources regarding benefitis by using C3 over VB? /Andy
34
by: Eric Wise | last post by:
Does anyone work for companies that actually implement both VB and C#? I know that you can do this in theory, I just find it hard to imagine that a company would split its programming technologies...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
25
by: Sharrukin Amiri | last post by:
Hello, I am using VB 6.0 for many years. Everytime I needed to build software applications, I just opened VB 6.0 and started coding. I am now looking VB.NET Express Edition and I find I can no...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.