Alex_net Posted September 9, 2004 Posted September 9, 2004 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: Quote
Administrators PlausiblyDamp Posted September 9, 2004 Administrators Posted September 9, 2004 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.