callraheel
Well-known member
Hi there
I have created a form , a main panel and a lot of panels inside the main panel by getting data from database... Everything gone fine.
Now i came across a problem.
In those "a lot of panels" i have a button "View Full Details", "Update" and "Delete"....
As panels are added on run time so i need such a handler which could give the reference of panel through which button is clicked...
I hope you got what i want
For now im using the following handler for clicking of the panel... note there is a loop which create new panels and then add handles to these panels and add them to main panel
' code im using to add handler
AddHandler objPanel.Click, AddressOf _ChangeBackColor
' code of the sub _changeBackColor
Private Sub _ChangeBackColor(ByVal e As System.Object, ByVal ev As System.EventArgs)
' i need to change the back color of current panel being clicked...
pnlMain.BackColor = Color.PeachPuff
End Sub
It work well but do not give me the reference of panel at which the mouse was clicked and also i need to change the back color of current panel...not main panel...How can i do this....Please help out........I'm stucked here...
Regards
Raheel
I have created a form , a main panel and a lot of panels inside the main panel by getting data from database... Everything gone fine.
Now i came across a problem.
In those "a lot of panels" i have a button "View Full Details", "Update" and "Delete"....
As panels are added on run time so i need such a handler which could give the reference of panel through which button is clicked...
I hope you got what i want
For now im using the following handler for clicking of the panel... note there is a loop which create new panels and then add handles to these panels and add them to main panel
' code im using to add handler
AddHandler objPanel.Click, AddressOf _ChangeBackColor
' code of the sub _changeBackColor
Private Sub _ChangeBackColor(ByVal e As System.Object, ByVal ev As System.EventArgs)
' i need to change the back color of current panel being clicked...
pnlMain.BackColor = Color.PeachPuff
End Sub
It work well but do not give me the reference of panel at which the mouse was clicked and also i need to change the back color of current panel...not main panel...How can i do this....Please help out........I'm stucked here...
Regards
Raheel