Hello,
We am trying to implement a search mechanism in WinForms that behaves like an Outlook Search bar.
In a default state it acts like a combo editor, but when you hit the drop down you get a custom User Control
Default State
Drop Down State
I was thinking to use a PopupControlContainerTool with a windows TextBox as a control and when it pops open replace with a custom user control that looks like the above.
So when the form loads, we create a textbox and add it to the popup container tool (like the code on your tutorial). However it does not show in the textbox in the toolbar menu, just the drop down button. Maybe this is the wrong tool to use but I can't figure out another way to accomplish our desired outcome.
Thanks for you help.
M.
Hello and thank you for contacting Infragistics.
Rather than a popup container tool, its preferred to use a control container tool. Use a modified version of our UltraComboEditor inside the control container tool. This combo will need to remove it's defaults dropdown button, and add a user control for the dropdown. This will be up to you to decide. If you have a control already built, an instance is all that is needed to be used.
I attached a sample demonstrating this and I used a very basic user control to demonstrate this process.
Here are some useful settings on the combo that are needed that I set in the form's designer.cs
this.ultraComboEditor1.ButtonsRight.Add(dropDownEditorButton1); this.ultraComboEditor1.DropDownButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Never; this.ultraComboEditor1.DropDownListAlignment = Infragistics.Win.DropDownListAlignment.Right;
Let me know if you have any questions.
ToolbarControlContainerTool.zip
One question : How do I set the usercontrol to be in the drop down area of the combo editor?
Thanks,
The DropDownEditorButton has a Control property. See line 129 in Form1.Designer.cs
dropDownEditorButton1.Control = this.userControl11;
Thank you! And we're happy with your loyalty.
Thanks, I got everything I wanted to accomplish done this is great. I have to say I am happy to be with IG for all these years.
Change the RightAlignDropDown setting on the DropDownEditorButton to False:
dropDownEditorButton1.RightAlignDropDown = Infragistics.Win.DefaultableBoolean.False;
This is what I mean...see how it is pushed out to the left? I would like it pushed out to the right:
That worked. Last question...is there a way to make the drop down control alignment be right or center instead of left?