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

How to create a pop-up window in VB.net

13
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
Sep 15 '08 #1
7 24907
cloud255
427 Expert 256MB
THis is really basic stuff, i would advise that you do some reading, but here it is anyway:

in the button's OnClick event:

Expand|Select|Wrap|Line Numbers
  1. MessageBox.Show(args)
there are something like 21 overrides for the show function, so just have a look for which option is right for you.
Sep 15 '08 #2
nav010
13
i dont want to open messagebox, i want to open a new window in which i can show other controls or add more controls.
Sep 15 '08 #3
cloud255
427 Expert 256MB
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:

Expand|Select|Wrap|Line Numbers
  1. form2.show()
you can then close the first form...

Good luck
Sep 15 '08 #4
Curtis Rutland
3,256 Expert 2GB
To do this the right way, you will need to instantiate it first:
Expand|Select|Wrap|Line Numbers
  1. Dim f2 as new form2()
  2. f2.Show()
  3.  
VB.NET may let you get away without doing that, but it's not proper coding.
Sep 15 '08 #5
cloud255
427 Expert 256MB
To do this the right way, you will need to instantiate it first:
Expand|Select|Wrap|Line Numbers
  1. Dim f2 as new form2()
  2. f2.Show()
  3.  
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?
Sep 15 '08 #6
Curtis Rutland
3,256 Expert 2GB
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.
Sep 15 '08 #7
MrMancunian
569 Expert 512MB
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.

Expand|Select|Wrap|Line Numbers
  1. Dim form as new Form()
  2. form.ShowDialog()
  3.  
Sep 16 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

17
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...
4
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.
9
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,...
1
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...
25
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...
7
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...
7
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...
0
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...
1
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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
jinu1996
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...
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.