I am new to VB.net
I want to create a pop up window in VB.net. Whenever I click a button, a pop up window should appear.
Early Response would be appreciated.
Thanks
7 24907
THis is really basic stuff, i would advise that you do some reading, but here it is anyway:
in the button's OnClick event:
there are something like 21 overrides for the show function, so just have a look for which option is right for you.
i dont want to open messagebox, i want to open a new window in which i can show other controls or add more controls.
i dont want to open messagebox, i want to open a new window in which i can show other controls or add more controls.
Ok, still using the OnClick event, you create your second form in the designer and then call it when the button is clicked:
you can then close the first form...
Good luck
To do this the right way, you will need to instantiate it first: -
Dim f2 as new form2()
-
f2.Show()
-
VB.NET may let you get away without doing that, but it's not proper coding.
To do this the right way, you will need to instantiate it first: -
Dim f2 as new form2()
-
f2.Show()
-
VB.NET may let you get away without doing that, but it's not proper coding.
Even if you create the form in the designer and add it to the project before calling it?
Even if you create the form in the designer and add it to the project before calling it?
Of course. Creating the form is creating a class. Classes are the description, the blueprint of an object. In the same way that you define an instance of a String before you can use it, you should have to do the same for an instance of a form. But I think VB.NET cheats for you and automatically instantiates one for you. But it's sloppy programming to rely on that. For clarity and best practices, you should instantiate your forms. Also, in case you ever have to work with C#, or other less forgiving languages, you'll not have problems.
By the way, if you really want it to be a nagging pop-up that makes sure your program can't be used unless the pop-up is closed, you should use ShowDialog instead of Show. -
Dim form as new Form()
-
form.ShowDialog()
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ralph |
last post by:
Hi all,
Recently I have tried to create a static lib using MS VC++.
The following are some of the excerpt of my codes:
********* MyFirstStaticLib.c *******************
#include...
|
by: wil |
last post by:
Dear All,
In the linux platform, is there anyway I can in a C program change the
file create date?
Thanks,
wil.
|
by: Surrealist |
last post by:
I need something likes as when I create an event procedure.
I can use top-left and top-right dropdown list of code editor
to select object and its exposed events respectively.
Then, the IDE,...
|
by: jamest |
last post by:
I'm developing a pop out menu using FW/DW MX (version 6.0?) and all works pretty well except for this:
when the mouse pointer moves off of the triggering hot spot and on to the resulting pop out...
|
by: Nicholas Parsons |
last post by:
Howdy Folks,
I was just playing around in IDLE at the interactive prompt and typed
in dir({}) for the fun of it. I was quite surprised to see a pop
method defined there. I mean is that a...
|
by: Scott |
last post by:
As said before I'm new to programming, and I need in depth explaination to
understand everything the way I want to know it, call it a personality quirk
;p.
With pop() you remove the last element...
|
by: AZRebelCowgirl73 |
last post by:
I am currently working on a homework assignment and I am stumped. Basically I have done most of what is required, however my stack is not correctly using the pop function. This is what I have so...
|
by: Gabriel Genellina |
last post by:
En Thu, 08 May 2008 09:24:37 -0300, Aspersieman <aspersieman@gmail.comescribió:
Use socket.setdefaulttimeout(timeout_in_seconds) before you create the POP3 object; this value will be used by the...
|
by: Joe, G.I. |
last post by:
I'm new to boost and what I'm doing seems very simple, but I can't get
it. I want to store 3 events onto a priority_queue and have them execute
n seconds from the time they were created, n is a...
|
by: peter peterson |
last post by:
I have been looking at memory pools and was wondering what would be wrong with creating a singleton which create a "pool" of (allocated) pointers to a given struct/class( in the case below Messages...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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,...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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: 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,...
|
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...
| |