-
objects on other forms
If you want to call properties of objects on other forms , how to do?
I have two forms : Form1, Form2
On Form1 I have a textbox
On Form2 I have a button
When I push the button on form2 I want the forecolor of the textbox change!
How to do??? Please help me? It isn't difficult I think.
-
RE
It's something that changed in VB6, but I don't know how to do :(
-
This is not exactly what you are trying to do but very similiar. Hope it helps:
http://www.vbforums.com/showthread.p...hreadid=104649
-
Try this to close form2 from form1:
Public Class Form1
Inherits System.Windows.Forms.Form
Dim frm2 As New Form2()
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
frm2.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
frm2.Close()
End Sub
End Class
-
!! RE !!!
This works , thank you, but I had this already. Sorry. Good, but now I need to change properties from controls on other forms. The code from joachim doesn't work! :( :(
-
Dear NicoVB:
Yes, there is an easier way to get your requirement done.
There is a Property called Modifier. I am not sure whether it belongs to the Form or to a Control as I do not have VB.NET at the moment. I guess, it should be a Property of a Control. Please let me know.
If you want to access a control from outside then you have to set that Property to Public. The default value is Private.
Could you please let me know the outcome?
Hope this helps.
Good Luck !!!
-
!!
I don't find that property!! Were can you find that property?? Of which class is it a member??
-
Dear NicoVB:
Could you please check whether you find Modifier Property in Form1's TextBox?
Hope this helps.
Good Luck !!!