Results 1 to 4 of 4

Thread: Can't make checked list box and listbox in same size

  1. #1
    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.

  2. #2
    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'.

  3. #3
    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.

  4. #4
    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,031,973.27820 seconds with 17 queries