Jump to content
Xtreme .Net Talk

A very big problem with VB.net and XP Service Pack2(maybe). HELP!!!


Recommended Posts

Posted

Hello. I have a very strange problem with my VB.net(it is Visual Studio 2003).

I've already written some programs in VB.net early and they are working now but every new Project has such problem. A small example:

 

Form1:

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Call Check()

End Sub

 

 

modCheck:

 

Public Display As New Form1

 

Public Function Check()

Dim strTemp As String

 

strTemp = Display.TextBox1.Text

If strTemp <> "" Then

MsgBox("It's working!")

End If

End Function

 

The problem is, that the program doesn't see textbox on the form. It means if i've written something in the textbox and it is not empty now, the program doesn't understand. It thinks that the textbox is still empty. Also i can't to wite something in the textbox or at the label if they are on a Form and i try to make it from a module. I don't see any connection between the problem and Service Pack 2, but exactly after installation i've got this problem. I've already reinstalled the Visual Studio but i still have the problem. Somebody can help me? :confused:

  • Administrators
Posted

you will need to pass an instance of the current form to the check function, rather than declaring a new one within the module.

http://www.xtremedotnettalk.com/showthread.php?t=83092 may be worth having a look at as it covers how to use forms under .Net.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...