hi,
i have created one form in which when user log in that form will show all the accounts related to that user and that will shown in link label like this
account 1
account 2
account 3
Now my question is when user clicks account 1 it will show detail for account 1 and when user clicks account 2 it will show detail for account 2
it may be 3 accounts or it may be 5 or any more.
i have added linklabel like this
problem is when i press account 3 than and than l_click event works otherwise for account 1 and account 2 it is not working... It means for last control it is adding during runtime event is called otherwise not. I want to call event for all the accounts what should i do? I hope answer will come fast....
i have created one form in which when user log in that form will show all the accounts related to that user and that will shown in link label like this
account 1
account 2
account 3
Now my question is when user clicks account 1 it will show detail for account 1 and when user clicks account 2 it will show detail for account 2
it may be 3 accounts or it may be 5 or any more.
i have added linklabel like this
VB.NET:
[size=2][color=#0000ff]Dim[/color][/size][size=2] [/size][size=2][color=#0000ff]WithEvents[/color][/size][size=2] l [/size][size=2][color=#0000ff]As[/color][/size][size=2] LinkLabel /* global variable [/size]
form_load event*/
[size=2][size=2][color=#0000ff]Do[/color][/size][/size]
[size=2][size=2]l = [/size][size=2][color=#0000ff]New[/color][/size][size=2] LinkLabel()[/size][/size]
[size=2][size=2][color=#0000ff]Me[/color][/size][size=2].Controls.Add(l)[/size][/size]
[size=2][size=2]l.Text = "Account" & " " & dr1.Item("countrow") & " " & "from" & " " & dr1.Item("column1")[/size][/size]
[size=2][size=2]l.Visible = [/size][size=2][color=#0000ff]True[/color][/size][/size]
[size=2][size=2]l.Enabled = [/size][size=2][color=#0000ff]True[/color][/size][/size]
[size=2][size=2]l.AutoSize = [/size][size=2][color=#0000ff]True[/color][/size][/size]
[size=2][size=2]l.Top = t + 40[/size][/size]
[size=2][size=2]t = l.Top[/size][/size]
[size=2][size=2][color=#0000ff]Loop[/color][/size][size=2] [/size][size=2][color=#0000ff]While[/color][/size][size=2] dr1.Read[/size][/size]
[size=2][/size]
[size=2][size=2][color=#0000ff][size=2][color=#0000ff]Private[/color][/size][size=2] [/size][size=2][color=#0000ff]Sub[/color][/size][size=2] l_Click([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] sender [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]Object[/color][/size][size=2], [/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] e [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.EventArgs) [/size][size=2][color=#0000ff]Handles[/color][/size][size=2] l.Click[/size][/color][/size][/size]
[size=2][size=2][color=#0000ff][size=2][color=#0000ff]Dim[/color][/size][size=2] f [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]New[/color][/size][size=2] form1()[/size][/color][/size][/size]
[size=2][size=2][color=#0000ff][size=2]f.Show()[/size][/color][/size][/size]
[size=2][size=2][color=#0000ff][size=2][color=#0000ff]Me[/color][/size][size=2].Hide()[/size][/color][/size][/size]
[size=2][size=2][color=#0000ff][size=2][color=#0000ff]End[/color][/size][size=2] [/size][size=2][color=#0000ff]Sub[/color][/size][/color][/size][/size]
problem is when i press account 3 than and than l_click event works otherwise for account 1 and account 2 it is not working... It means for last control it is adding during runtime event is called otherwise not. I want to call event for all the accounts what should i do? I hope answer will come fast....