Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-08-2009
Member
 
Join Date: Oct 2008
Posts: 105
Can't make checked list box and listbox in same size

I can not make the DrawItem event to work on the CheckedListBox control. It's not called if the user clicks in the empty area from the right edge of the TextBlock to the right edge of the ListBox. What i want to do is to does not allow user to edit listbox or combobox items at run time. I tried to use "LOCKED" property of listbox and combobox control But it locked entire contol. ot make the DrawItem event to work on the CheckedListBox control.
Reply With Quote
  #2  
Old 06-08-2009
Member
 
Join Date: Dec 2008
Posts: 202
Re: Can't make checked list box and listbox in same size

I suspect that you are not clicking inside of the stack panel that is why the mouse event is not firing. You might have to set the width of the stack panel. To your newly created form add from the Toolbox a ListBox named 'itemList', a TextBox named itemName and three buttons named 'cmdAdd', 'cmdRem' and 'cmdClr'.
Reply With Quote
  #3  
Old 06-08-2009
Member
 
Join Date: Feb 2006
Posts: 172
Re: Can't make checked list box and listbox in same size

Put your stackpanel into a grid and insert an invisible rectangle under the stackpanel. You can however 'cheat' and make a regular ListBox look like a CheckedListBox. The DrawMode/DrawItem in CheckedListBox is used internally only.Set your rectangle to stretch in all directions, finally apply your eventhandler to the grid and not the stackpanel.
Reply With Quote
  #4  
Old 06-08-2009
Member
 
Join Date: Oct 2008
Posts: 117
Re: Can't make checked list box and listbox in same size

You can however, Inherit from CheckedListBox and override the OnDrawItem method. I also tried commenting out all the stuff withen the ControlTemplate however that didn't help. Simply setting the Template seems to cause problems. This saves you having to implement the checked property of the items, which you would need to do if you inherit from ListBox or else just custom paint Listbox.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Can't make checked list box and listbox in same size"
Thread Thread Starter Forum Replies Last Post
Is it screen size of monitor make difference in FPS rate? Ecchumati Monitor & Video Cards 4 25-11-2011 02:38 PM
Need Adapter for micro-SIM to make full size SIM Galimberti Portable Devices 7 30-05-2010 11:11 PM
JOptionPane.showInputDialog size list New ID Software Development 5 19-01-2010 12:06 PM
How to make size of jpeg files smaller Beneficence Customize Desktop 4 17-02-2009 11:08 PM
Can I make the video clip of less size Zombi Windows Software 3 20-10-2008 08:07 PM


All times are GMT +5.5. The time now is 07:26 AM.