Labels

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Public Class Clas1
Inherits System.Windows.Forms.UserControl
Friend WithEvents lblStatus As System.Windows.Forms.Label
private cl As new Class2

Cl = new Class2(lblStatus)
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
 
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
 
Hi,
picResult.Controls.Add(class1)
this is how I show my class (or userControl window)

thank you for your time
 
Lamis,

I saw that you have now placed this question as well in the newsgroup
microsoft.public.dotnet.languages.vb

And saw that you got an excelent answer from Armin.

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

Cor
 
Back
Top