Create .NET component like Windows Search Toolbar
Does anyone know the way to create on .NET (better with c#) control inside taskbar? There is a good utility for time-management, LazyCure, but it's a little more than needed. As it's free, I want to create a minimize look, and开发者_如何学编程 this variant now is the better for me.
Image how it should look like - below.
You can create a custom control that visually and functionally resembles a Windows Vista-style search box. This will work in any .NET WinForms project, including C# or VB.NET; just drop it on to a form and wire up the relevant event handlers.
Here's an excellent tutorial: http://coderjournal.com/2007/03/creating-a-vista-like-search-box/
I don't really understand what you're asking regarding LazyCure. I haven't heard of it, but the way I read the question, you just want to use a search box in your re-implementation of a similar utility. If so, the above method will work fine for you.
If you are hoping to place the control in the Windows Taskbar, that's going to be a lot more difficult. You might look at the following articles for some suggestions on how you might go about accomplishing this:
http://www.codeproject.com/KB/shell/dotnetbandobjects.aspx
http://www.codeproject.com/KB/statusbar/taskbarctrl.aspx
Or you could simply place your application's icon in the taskbar's Notification Area so it is always easy to access, like the volume control or some other common utility programs. The NotifyIcon
component provided as part of the .NET Framework makes implementing this functionality very simple.
If you're using wpf the toolbar will accept any control, including your own custom controls.
Edit:
First, have a look at the MSDN documentation on wpf's toolbar. Toolbar is quite simple to use, and the documentation explains it pretty well.
Basically, you just create an instance of your custom control as a content item of the toolbar. In the examples in the documentation, the content items are Button
but it could be any other control.
If you need an example of how to create an instance of your custom control in XAML, including declaring the appropriate namespace, see this question on SO. His question says he's having a problem, but his code and example is correct--it was entirely VS2008's error.
精彩评论