开发者

How can i override the ItemHeight property of listbox?

I want to set the itemHeight property of CheckedListBox. but it doesnot have the ItemHeight Property.since CheckedListBox is derived from ListBox cl开发者_Python百科ass,i want to override the ItemHeight Property of ListBox class. Can anyone tell me the solution?


you can derive a class from CheckedListBox and override ItemHeight to return base.ItemHeight+<value by which you wish to increase the height>. You would then have to use this new class that extends the CheckedListBox.
Also, You could make the CheckedListBox owner draw with the property OwnerDrawVariable and use MeasureItem.

For details, see http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.measureitem.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜