forms do not repond

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the standard code for showing the form.

dim msgForm = New Form1()
msgForm.Show()
although it does show the form, but it is a just a blank white background
and when i take the mouse their it changes to an 'hour glass' i click the
mouse on it and the form just stops to repond.

Is their anything i am missing. I know it is very basic.
irfan
 
sounds like you have an infinite loop in your Form_Load routine.

Post the code.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Irfan,

When you have created your application using VB.Net or a version of Visual
Studio Net, than you don't have to do anything to show your main form.

In VBNet is a build in procedure that shows that.

I think that is your probably your problem.

Therefore remove those two rows try and when it does not go tell us.

I hope this helps

Cor
 
Irfan Mumtaz said:
dim msgForm = New Form1()
msgForm.Show()

I suggest to enable 'Option Strict':

\\\
Dim MsgForm As New Form1()
MsgForm.Show()
///

However, this won't solve the problem.
although it does show the form, but it is a just a blank white background
and when i take the mouse their it changes to an 'hour glass' i click the
mouse on it and the form just stops to repond.

Which controls are you using on your form? Are you performing any
operations in the form's 'Load' event?
 
It took Pete's suggestion, but it didnt work.
Nick' s sugestion that there might be endless loop, but i am opening a new
poject and using just these two lines to show the form

However, the form does show up when i make it as startup object but the
problem arises when i call the form from a module or main sub

Dim msgForm As New Form1()
msgForm.Show()

I still dont know the reason for this basic problem

I am using vb.net 2003
 
i tried to put msg box, when it reaches End sub it shows both, msgbox and the
form1,
Option Strict On
Module Module1
Sub main()
Dim msgForm As New Form1()
msgForm.Show()
MsgBox("hello")

End Sub
Sub open()

End Sub
End Module
 
Irfan Mumtaz said:
i tried to put msg box, when it reaches End sub it shows both, msgbox and
the
form1,
Option Strict On
Module Module1
Sub main()
Dim msgForm As New Form1()
msgForm.Show()
MsgBox("hello")


Use 'Application.Run(MsgForm)' instead of calling the form's 'Show' method.
 
Irfan,

Dont use that module main (as I do it) or do it with that application.Run as
Herfried suggest.
(You can set your startup form in the properties from the project)

I hope this helps,

Cor
 
It probably doesn't make any difference but I use
dim msgForm as Form1 = New Form1
 
considering the simplicity of your app, is there some reason you've chosen
NOT to post 100% of the code?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Have you tried
dim msgForm = New msgForm
msgForm.Show()

(I guess it would depend on what you named your form. I did this once, and
switched the position of the name of my form with the variable)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top