Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display UserControl as popup window

I have a UserControl where I have some buttons and textboxes. I was wondering how I can display that UserControl when a user clicks a button.

like image 766
Erik Avatar asked Nov 22 '25 16:11

Erik


1 Answers

A user control cannot be a 'popup window', that requires a toplevel window. A form. You can put the user control in a form and use the form's Show() method to make it visible.

Fwiw, turning a user control into a toplevel window is technically possible with the SetTopLevel() method. It isn't worth the hassle, it won't behave like a proper one.

like image 185
Hans Passant Avatar answered Nov 24 '25 07:11

Hans Passant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!