Talk2Tom11 Posted August 7, 2004 Posted August 7, 2004 I was wondering if it is possible to change the properties of something on one form, from a button on another form. For example: if I click bnt1 on form2, it will make txtbox1.enabled = true. Quote
Administrators PlausiblyDamp Posted August 7, 2004 Administrators Posted August 7, 2004 you may want to look here as it covers the basic ideas needed for working with multiple forms. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Talk2Tom11 Posted August 9, 2004 Author Posted August 9, 2004 thank you for the thread, but in there code which is this: Public Class Form1 Inherits System.Windows.Forms.Form ' Windows Forms Designer generated code region Private otherForm As New Form2() Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click otherForm.Text = "Foo" otherForm.Show() End Sub End Class they change the text of form2.... where I want to change a label's text on form2. I tried the following code otherform.label1.text = "Hello" when I used that, I didn;t get any errors, but it didn't work... does anyone have an idea as to why. Quote
Administrators PlausiblyDamp Posted August 9, 2004 Administrators Posted August 9, 2004 Either make the label itself public - not very OO though, or create a public property that changes / retreives the label's text - much more OO. 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.