see sharp RSS 2.0
# Saturday, 21 February 2009
For some reason I needed to add a Control to a Toolstrip. There are some ToolStrip enabled controls in the framework, but I needed a checkbox.
So, after a short time with Windows Live Search, I found the  ToolStripControlHost class which comes quite handy for that task.
Just create your control, create a  ToolStripControlHost , and add that to the toolstrip.
Voila, thats it.

CheckBox cb = new CheckBox();
cb.Text = "Test";

ToolStripControlHost ch = new ToolStripControlHost(cb);

this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { ch });

MSDN describes that  here in great detail...

Saturday, 21 February 2009 14:54:17 (Mitteleuropäische Zeit, UTC+01:00)  #    -
C#
Archive
<2009 February>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
Any link on this site may lead to an external website that is not under my control and that external website might show an opinion that is not mine.

© Copyright 2017
Hannes Köhler
Sign In
Statistics
Total Posts: 39
This Year: 0
This Month: 0
This Week: 0
Comments: 1
All Content © 2017, Hannes Köhler
DasBlog theme 'Business' created by Christoph De Baene (delarou)