Listbox2 Height and Width CF3.5

Last post 05-30-2008 11:56 by redwolf. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-07-2007 4:15

    Listbox2 Height and Width CF3.5

    Hi,

    I've just started using Listbox2 in VS2008 Beta 2. I'm using LINQ (or starting to) so I've opted for Compact Framework 3.5.

    I've place the Listbox on a Tabcontrol and during runtime I'm setting the Height and Width of the Listbox to be the same as the TabPage.

    But the Listbox stays the same size and does not get re-sized.

    Everything else works fine.

    I know the SDF2.x is for CF2.0.

    Any ideas?

    Pete
  • 11-08-2007 7:17 In reply to

    Re: Listbox2 Height and Width CF3.5

    Hi

    I've solved my problem by setting the bounds instead of height and width. It works perfectly now.

    Also I have to use "insert" instead of "add" because if I use "add" I cannot change the forecolor for individual cells but I can if I use "insert"

    Pete
    pete@infonote.com
  • 03-12-2008 7:38 In reply to

    • Essam
    • Top 200 Contributor
    • Joined on 03-12-2008
    • Posts 4

    Re: Listbox2 Height and Width CF3.5

    How did you manage to set the Bounds property ??? it keeps giving me an error when I try to change the Bounds width and height and keep saying that  it is not a variable, so I wonder how you managed to do that !!! Can you post the line of code you used please ???

     

     

    thanks,

    essam

  • 05-30-2008 11:56 In reply to

    Re: Listbox2 Height and Width CF3.5

    Simply set the Size to the same size as the tabcontrols by

     tabControl_Resize(object sender, EventArgs e)

    {

        listBox.Size = tabControl.Size; 

    }
     

Page 1 of 1 (4 items)