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
精彩评论