Labels

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lamis

    #1

    Labels

    Hi,

    I am using VB .Net.
    i have 2 forms.. one is windows form and I have a lable there that i do want
    to control from class1. I thought I could send a referense to the label but
    I don't know how to do that in VB
    How do I declare the referens in class2??? I need to change color+text from
    class2

    --
    LZ
  • Cor Ligthert [MVP]

    #2
    Re: Labels

    Lamis,

    There are three types of form in .Net which acts different.

    A MDI form
    A normal form showed with show
    A dialog form showed with showdialog

    What kind of form are you using?

    Cor


    Comment

    • Lamis

      #3
      Re: Labels

      Public Class Clas1
      Inherits System.Windows. Forms.UserContr ol
      Friend WithEvents lblStatus As System.Windows. Forms.Label
      private cl As new Class2

      Cl = new Class2(lblStatu s)
      End class

      Public Class Class2

      Public Sub New(ByRef instLblText As System.Windows. Forms.Label)
      Init()
      End Sub

      Private Sub Init()
      'I need here to give instLblText a green background ans chande it's
      color and update the grafic in clas one where the label is shown
      End Sub

      --
      LZ


      "Cor Ligthert [MVP]" wrote:
      [color=blue]
      > Lamis,
      >
      > There are three types of form in .Net which acts different.
      >
      > A MDI form
      > A normal form showed with show
      > A dialog form showed with showdialog
      >
      > What kind of form are you using?
      >
      > Cor
      >
      >
      >[/color]

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Labels

        Lamis,

        This is how a form is created not how it is used (showed) and with that
        under the hood used in another way.,

        Cor


        Comment

        • Lamis

          #5
          Re: Labels

          Hi,
          picResult.Contr ols.Add(class1)
          this is how I show my class (or userControl window)

          thank you for your time
          --
          LZ

          Comment

          • Cor Ligthert [MVP]

            #6
            Re: Labels

            Lamis,

            I saw that you have now placed this question as well in the newsgroup
            microsoft.publi c.dotnet.langua ges.vb

            And saw that you got an excelent answer from Armin.

            I am following that as well there so will stop it here.

            Cor


            Comment

            • Lamis

              #7
              Re: Labels

              hi cor,

              Yes I have now solved my problem :-) thanx
              --
              LZ


              "Cor Ligthert [MVP]" wrote:
              [color=blue]
              > Lamis,
              >
              > I saw that you have now placed this question as well in the newsgroup
              > microsoft.publi c.dotnet.langua ges.vb
              >
              > And saw that you got an excelent answer from Armin.
              >
              > I am following that as well there so will stop it here.
              >
              > Cor
              >
              >
              >[/color]

              Comment

              Working...