CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2000
    Location
    Scotland
    Posts
    42

    How can I get the height of my text boxes and listboxes to match?

    Hello -

    Can anybody help me match the heights of my list boxes and text boxes?

    I am a form which dynamically loads up a combination of 20 user controls at run time. Each user control is a strip with a label, a checkbox and either a list box or a text box (of varying lengths).

    When the various user controls get loaded onto the form -the text boxes have more height than the list box in other user controls. The height of all text boxes is 285 and the height of the list box is 255 - however -I can't change the height property of the list box to 285.

    Does anyone know of a way to do this or tell me why I can't- or can you suggest a strategy for making all text boxes and list boxes have an equal height.

    Thanks very much.

    Mairi





  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How can I get the height of my text boxes and listboxes to match?

    if I remember correctly you have to set the windows style of your listbox to LBS_NOINTEGRALHEIGHT.
    From the docs:
    "The size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items."

    use the SetwindowLong API to set the window style.


  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: How can I get the height of my text boxes and listboxes to match?

    ... Or you can just set the 'IntegralHeight' property to false


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: How can I get the height of my text boxes and listboxes to match?

    ...just found it.
    still mentally stuck in VB 3 world... :-)


  5. #5
    Join Date
    May 2000
    Location
    Scotland
    Posts
    42

    Re: How can I get the height of my text boxes and listboxes to match?

    Thank you very much for taking the time to respond - this was just what I was after!

    Regards,
    Mairi


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured