-
Sep 6th, 2004, 10:37 AM
#1
Thread Starter
Fanatic Member
ListBox row height
Does anyone know of a simple way to calculate the height of a row in a listbox? I'm trying to get my listbox to resize depending on the number of items in it, so that it's always exactly the right height.
Ta...
-
Sep 6th, 2004, 10:39 AM
#2
Frenzied Member
mark one, take a screenshot and measure it in paint?
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Sep 6th, 2004, 10:43 AM
#3
VB Code:
Option Explicit
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) _
As Long
Private Const LB_GETITEMHEIGHT = &H1A1
Private Sub Command1_Click()
Dim lHeight As Long
lHeight = SendMessageLong(List1.hwnd, LB_GETITEMHEIGHT, 0&, 0&)
MsgBox lHeight & " pixels in height"
End Sub
Private Sub Form_Load()
List1.AddItem "Test"
End Sub
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 6th, 2004, 10:49 AM
#4
Frenzied Member
My method's less icky
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Sep 6th, 2004, 11:22 AM
#5
Originally posted by vbNeo
My method's less icky
What happens when he changes fonts? Then another screenshot needs to be taken and all that.
Poo on you.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 7th, 2004, 02:13 AM
#6
Frenzied Member
Originally posted by crptcblade
Poo on you.
Poo isn't icky
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|