|
-
Dec 3rd, 2002, 03:06 PM
#1
Thread Starter
Addicted Member
Easy form question
Ok I need some quick help with a form problem. I'm trying to change the Title of the form using code. Whenever I load the form though, it still comes up as "Form1"
VB Code:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm As New Form1()
frm.Text = "TextChanged"
End Sub
End Class
What am I doing wrong?
-- Ethan --
VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
MCP & A+ Certified. Looking for a job in the Seattle, WA area.
-
Dec 3rd, 2002, 03:26 PM
#2
Registered User
-
Dec 3rd, 2002, 03:41 PM
#3
because you are creating a NEW instance of form1 and naming it but you never show it.
Should be Me.Text = "blah" like athley said
-
Dec 3rd, 2002, 07:29 PM
#4
Thread Starter
Addicted Member
What if I want to change the .Text of a form from within another form? Then I can't use "Me.Text = 'whatever'". So what should I do? .NET is going to take some getting used to.
-- Ethan --
VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
MCP & A+ Certified. Looking for a job in the Seattle, WA area.
-
Dec 3rd, 2002, 08:25 PM
#5
Frenzied Member
No, you would'nt use Me.Text. You would have to pass a reference of that form to the next form, then change what you want.
Dont gain the world and lose your soul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|