I have user control that accept 3 String and set it into 3 labels.
on load of the user control i set default value,and when i pass the paremeter the label will change it's text.
but my problem is the lables not changing it's value at all, i check the code and see the user control read all the value but nothing happen :(
Sorry for my bad english
-----------
Form Login
------------
Imports System.Data.OleDb
Imports System.IO
Imports System
Imports System.Windows.Forms
Public Class FrmLogin
Dim mb As New _userCompanyBar()
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Public Sub New()
InitializeComponent()
Me.Controls.Add(mb)
End Sub
Private Sub _BtnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _BtnLogin.Click
End Sub
Private Sub _BtnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _BtnCancel.Click
Me.Close()
End Sub
Private Sub LoginForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim _companyBUS As CompanyBUS
_companyBUS = New CompanyBUS
Dim _CompanyVO = New CompanyVO()
_CompanyVO = _companyBUS.getCompany()
Try
If Not (_CompanyVO Is Nothing) Then
mb.setData(_CompanyVO.CompanyName, _CompanyVO.CompanyAddress, _CompanyVO.CompanyPhone)
End If
Catch ex As Exception
End Try
End Sub
End Class
---------------
_userCompanyBar
-------------
>_userCompanyBar
Imports System.ComponentModel
Public Class _userCompanyBar
Dim Company = "Company Name"
Dim CompanyAddress = "Company Address"
Dim CompanyPhone = "Company Phone"
Public Sub CompanyBar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
_lbCompanyName.Text = Company
_lbCompanyAddress.Text = CompanyAddress
_lbCompanyTelp.Text = CompanyPhone
End Sub
Private Sub _pnBackgroundColor_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles _pnBackgroundColor.Paint
End Sub
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Public Sub New(ByVal _CompanyName As String, ByVal _CompanyAdresse As String, ByVal _CompanyPhone As String)
' This call is required by the Windows Form Designer.
InitializeComponent()
setData(_CompanyName, _CompanyAdresse, _CompanyPhone)
End Sub
Public Sub setData(ByVal _CompanyName As String, ByVal _CompanyAdresse As String, ByVal _CompanyPhone As String)
_lbCompanyName.Text = _CompanyName
_lbCompanyAddress.Text = _CompanyAdresse
_lbCompanyTelp.Text = _CompanyPhone
End Sub
Private Sub _lbCompanyTelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _lbCompanyTelp.Click
End Sub
End Class</pre>