Results 1 to 8 of 8

Thread: objects on other forms

  1. #1
    NicoVB
    Guest

    Exclamation 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.

  2. #2
    NicoVB
    Guest

    RE

    It's something that changed in VB6, but I don't know how to do

  3. #3
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119
    This is not exactly what you are trying to do but very similiar. Hope it helps:

    http://www.vbforums.com/showthread.p...hreadid=104649

  4. #4
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119
    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

  5. #5
    NicoVB
    Guest

    !! 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!

  6. #6
    New Member
    Join Date
    Jan 2002
    Location
    Sri Lanka
    Posts
    3

    Lightbulb

    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 !!!

  7. #7
    NicoVB
    Guest

    !!

    I don't find that property!! Were can you find that property?? Of which class is it a member??

  8. #8
    New Member
    Join Date
    Jan 2002
    Location
    Sri Lanka
    Posts
    3
    Dear NicoVB:

    Could you please check whether you find Modifier Property in Form1's TextBox?

    Hope this helps.
    Good Luck !!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width