Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
:rose:
Hi.
If you put a ComboBox on your Form we see that there is a small Black Arrow on right top side of it, that open a small panel with CheckBox and a linklabel and...
Can you tell me,How can i do that for my Own Controls??
Thank you.
:rose:
Posted

My guess is that you are looking for a way to implement a popup control.

Here is a nice article Simple Popup Control[^] by Lukasz Swiatkowski.

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Jan-11 2:07am    
I think you're right - my 5.
Sorry OP probably did not understand my explanation, but I can expect a lot more issues down the road.
Same appearance needs same framework.

If your group want to have a solid architecture your group must have (or make) your own framework.

Then your user controls will be as you want.
 
Share this answer
 
The question contains one of the possible answers — UserControl:

Create a UserControl, put a text box and a small button with a small black arrow on right side, the button click will shows a small panel with its child controls. To mimic a list part of the combo box, this small panel should be shown on a separate window created immediately on top of the desktop -- this is how native combo box shows drop-down list. You will need to have separate window because the height of the combo box is equal to the height of its text box part, so the list box part (or your small panel) will not fit in the user control; dynamic increase of the user control size also will not work, because it would mess up the parent's layout.

This is not easy at all, by the way. It will require handling good number of events, taking care of tricky layout, expose sophisticated interface to allow the user of your control populating and accessing polymorphous list of the panel's child controls.

One example of a very characteristic problem: when a native combo box is shown in a form, and when it's drop-down list is shown, the user can deactivate the active form. You could have noticed: this hides the combo box's drop-down list; this is done this way to prevent this list box (at the level of desktop children) messing up with other top-level windows. But this activation events belong to the form, not to the control, so the appropriate action should be delegated to the form during run time...

Still interested to try?
 
Share this answer
 
v4
:rose:
Hi,Thank you for the answer.
But how its Possible that all the components that we have from diffent companys(Microsf,Dev,and...)Have the Same Take panel in their Components???
And also i have seen some of my friend created this Taks panel exacly like the thing we have in C# Controls!!!
It seems there must be a Standard.
And the way you said is UnPro.
I wait to get a better way...
Again Thank you for giving me your time.
:rose:
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Jan-11 13:22pm    
First of all, you're not supposed to post non-answer as an answer, please remove this in comment.
This way, it will be clear who are you're talking to.

Take panel, Task panel... what is it? You need to explain better.
There is no such notion or standard.
One application mimicking others is nothing special.

You mentioned behavior like combo-box and received an answer. You'll need to follow my advice and look at the Espen's Answer. But I would not advice to do it. Maybe you want to mimic bad design or your explanation is poor.
:rose:
Hi,Thank you it helped alot.
:rose:
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Jan-11 15:36pm    
First of all, you're not suppose to post non-answer as an answer, please move this to comment.

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