954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

Please help me I am new to VB.net and I want to create a pop-up window in VB.net

Thanks

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

Hi,

What do u exactly want do u want to show any message as a pop-up in vb.net or do you want to show entire other form as pop-up???

if u want message as a pop-up then you can write

MsgBox("<>", MsgBoxStyle.Information, "<>")

OR

MessageBox.Show("<>", "<>", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False)


if u want to open new form as pop-up then

Dim Obj as new Form1
Obj.Show()

or

Dim Obj As New Form1
Obj.ShowDialog()


Regards,
Vidyadhar

Please help me I am new to VB.net and I want to create a pop-up window in VB.net

Thanks

vidyadhar
Newbie Poster
3 posts since Sep 2008
Reputation Points: 10
Solved Threads: 2
 

i want to create pop-up as new form.
I tried to put your code
dim obj as new form1
obj.show()

but, Stackoverflow exception is there.

I want that whenever i click a button, a new pop-up window be opened.

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

Post your code.

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

Can you tell me what is ur forms name.. In my code give below you will have to replace form1 text with your forms name... Please try this and let me know if you are still getting any error write back to me with exact error message you are getting...

i want to create pop-up as new form. I tried to put your code dim obj as new form1 obj.show()

but, Stackoverflow exception is there.

I want that whenever i click a button, a new pop-up window be opened.

vidyadhar
Newbie Poster
3 posts since Sep 2008
Reputation Points: 10
Solved Threads: 2
 

My form name is also form1.

I am getting this error:

An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

Then post your code, it more help.
and which line of error...

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

Hi, i think i understand your requirement. Is it you want you click the button, and then the current form will be close, and the new form will pop up?

if this is your requirement, then the solution will as the following

when u click the button, then the form1 will close while the form2 will be pop up.
Me.Hide()
Form2.Show()

Hope this can help u..

rainny
Light Poster
29 posts since Dec 2007
Reputation Points: 6
Solved Threads: 1
 

Dim obj As New Form1


Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

obj.Show()

End Sub

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

Thanks
part of my problemis solved, but can it be done in another way, without taking another form.

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

hi friends, i'm new to vb.net, i've five combobox ctrl on my form. but i want select the data from ctrl and display in datagridcontrol by random
selection.......

gomathinayagam
Newbie Poster
17 posts since Nov 2008
Reputation Points: 8
Solved Threads: 1
 

hi all... i am with a lil bit diff problem.. i need to have a subform or panel/frame whatever we can say to appear in the main form depending on some condition. I don't want visibility option as i had successfully tried it but i need to make my form generic... kindly help

rohitgeek
Newbie Poster
1 post since Dec 2008
Reputation Points: 10
Solved Threads: 1
 

Hi rohitgeek! Please start a new thread for your question. You're not answering or solving the original question about pop-up windows. You'll get answers to your question when everybody sees what you are asking :)

And gomathinayagam could do the same.

Teme64
Veteran Poster
1,031 posts since Aug 2008
Reputation Points: 218
Solved Threads: 203
 

em...if your first form is startup form and you want call the new form and close the startup form, i think the better way is setup the solution/project properties at "Shutdown mode" choose "when last form-closes". If you choose this you can dispose the object (startup form) and the second form is not close.

witecloner
Newbie Poster
3 posts since Oct 2007
Reputation Points: 15
Solved Threads: 0
 

type Show.form2

imawesome511
Newbie Poster
1 post since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You