| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|
|||||||
| Visual Basic 6.0 Programming Ask questions about VB 6.0 (or earlier versions) or help others by answering their question. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
filelistbox integral height
Is there any way to turn OFF integral height on a filelistbox?
Because it is on the control size 'jumps' when the form is resized, which looks poor... Thanks in advance! |
|
#2
|
||||
|
||||
|
Re: filelistbox integral height
I don't understand, sorry.
What is the integral height? When does it jump? |
|
#3
|
||||
|
||||
|
Re: filelistbox integral height
Can you elaborate more please UKDavid. When I put a FileListBox on my Form and resize the form, I don't see anything weird
¿
__________________
My Latest Articles : Changing Mouse Settings with VB.NET || Creating Your Own Encryption / Decryption Program Using VB.NET 2005 || Autorun Menu Creator in VB.NET || Creating Your Own Tetris Game With VB.NET Part 1 Find All My Articles : Here FAQs : .NET FrameWork FAQs || Visual Basic.NET FAQs || C# FAQs Be The Change That You Want To See In The World - Michael Scofield, Prison Break; Season 1 Episode 1 Read This Before You Post || Acceptable Use Policy
|
|
#4
|
|||
|
|||
|
Re: filelistbox integral height
The FileListBox, much like the Listbox only resizes to specific sizes based upon the font size of the control in question so it does not automatically show the upper half of an entry whilst hiding the bottom part of the text under the 3d border of the control. This is the integral height the OP is talking about and while the standard listbox has this property (t/f), the FileListBox does not have this property.
As for solving this, use a standard listbox and populate it from a hidden FileListBox or... Code:
Option Explicit Private Const LB_ADDFILE = &H196 Private Const LB_DIR = &H18D Private Const DDL_ARCHIVE = &H20 Private Const DDL_HIDDEN = &H2 Private Const DDL_READONLY = &H1 Private Const DDL_DRIVES = &H4000 Private Const DDL_DIRECTORY = &H10 Private Const DDL_EXCLUSIVE = &H8000 Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Sub Command1_Click() SendMessage List1.hwnd, LB_DIR, DDL_EXCLUSIVE Or DDL_ARCHIVE Or DDL_HIDDEN Or DDL_READONLY, ByVal "E:\*.*" End Sub Good Luck |
|
#5
|
||||
|
||||
|
Re: filelistbox integral height
Brilliant stuff vb5prgrmr!
__________________
My Latest Articles : Changing Mouse Settings with VB.NET || Creating Your Own Encryption / Decryption Program Using VB.NET 2005 || Autorun Menu Creator in VB.NET || Creating Your Own Tetris Game With VB.NET Part 1 Find All My Articles : Here FAQs : .NET FrameWork FAQs || Visual Basic.NET FAQs || C# FAQs Be The Change That You Want To See In The World - Michael Scofield, Prison Break; Season 1 Episode 1 Read This Before You Post || Acceptable Use Policy
|
|
#6
|
|||
|
|||
|
Re: filelistbox integral height
vb5prgrmr's explanation is exactly what I meant
![]() Thanks all for looking and especially to vb5prgrmr for his solution. |
|
#7
|
|||
|
|||
|
Re: filelistbox integral height
Thanks to the both of you, but now if you don't mind Dave (Good Morning Dave
), could you please use the thread tools and mark this thread as resolved.Thanks once again |
|
#8
|
||||
|
||||
|
Re: filelistbox integral height
Very good. I didn't know about that integral height. Only I'm a little confused...
Quote:
|
|
#9
|
|||
|
|||
|
Re: filelistbox integral height
No, I think I got it right. Just add the controls to the form and look at their properties...
Yep! The Listbox control (List1) does have this property listed but the FileListBox (File1) does not have this property listed in the properties list. Now, how to see this in action... Add a standard list box, text box, and file list box to a dummy form. Click on the text box, hold the shift key down, and hold the down arrow key down for a second. You should see the text box change dimensions, specifically its height. (CTRL+Arrow key will move control around on form.). Now do the same for the list box. You should not be able to change its height this way until you set its integralheight property to false. Now, once you have resized the list box in this fashion, reset its integralheight to true and you will see that it changes dimension (height) to fit the closest size of x# of entries. The filelistbox on the other hand does not have this property and to resize this control during runtime, you must either use the mouse or directly enter a value in the height property. Hope that explains it a little better. Good Luck |
|
#10
|
||||
|
||||
|
Re: filelistbox integral height
Ok. Understood now. I misunderstood the term "having the integral height property".
As it seems, both List- and FileListBox HAVE the integral height property, only the FileListBox does not expose it, so you can't turn it off. |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|