C# WinForms Search Textbox and Toggle Button

WinForms Search Text Box
V2: Now uses GDI+ to draw the icons. Single code file instead of code + png images.
Here is a quick control I cooked up today for a project I'm working on. It is a winforms textbox with a search/clear button. It has two modes, search and clear. Each mode will show a different button and trigger a different event when the button is clicked. When using this in your own project, be sure to update the image paths and namespace. In the spirit of open source the license is GPL. I borrowed some code from other sources and they are listed in the code file.
Clear mode shows an X icon and fires the Cleared event. Clear mode also and clears the textbox when the button is clicked. Search mode shows the magnifying glass icon and fires the Search event when clicked. The default text can be customized using properties. The icons have an alpha channel use GDI+ so if you want to change the color of the button it should still look OK.

Download: https://github.com/BinaryConstruct/CSharpControls

search textbox

Winforms Toggle Button
Functions like a checkbox, but its a button!
toggle button

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Connect

RSStwitter

Support

Feel like supporting BinaryConstruct?

Recent Posts


TEdit
Instructions To install TEdit, simply download the latest version and unzip all contents to the...

TEdit - Terraria Map Editor
TEdit 3 Beta for Terraria 1.1.1 is available. If you would like to see it, check out github! What...

C# WinForms Search Textbox and Toggle Button
WinForms Search Text Box V2: Now uses GDI+ to draw the icons. Single code file instead of code +...

Resistor Heater X2
It turns out a single resistor wasn't enough to drive the extruder, so following some ideas from...

Caution Choosing a Thermistor
Temperature Tuning Part 1 Thermistors work very well when measuring temperatures near the middle of...