Click here to Skip to main content
15,897,147 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai
How to remove dynamically create picture box from vb form ? by specify the name or text need to remove control from form ,
Actually i will create picture box dynamically and its rigth click i will get name ,using that name i need to remove control.if code execute in same picture it not remove,so need to capture name in global variable and after execute click event can remove control ?



Regards
Aravind
Posted

1 solution

When you right click on the control, the handler method is passed the instance in the sender parameter.
You can use Controls.Remove[^] to remove the control from your form by passing that instance to the method.
 
Share this answer
 
Comments
Aravindba 24-Oct-13 1:18am    
Thank u for ur reply,in that article it remove radio button using another button and find exist or not in the form.but my need is if right click(in click event we can get left or right click)i need to remove which currently right clicked button that button only ,not using any other buttons,
OriginalGriff 24-Oct-13 3:03am    
Did you read what I said at all?
The example MSDN gives is never going to *exactly* solve your problem - it is a generic example of how to use the method or property.
Think a little bit, and read what I said...then apply the two pieces of code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900