Re: ListView Column Resize
- From: "Dave" <KingOfTheBeach@xxxxxxxxxxxxxxxx>
- Date: Wed, 24 Aug 2005 15:53:41 -0500
FYI - For anyone that reads through our conversation I said that the
GetWindowLong API with theGWL_STYLE parameter retrieves the correct state of
the Vertical scroll bar in lvwReport mode. This is an incorrect statement.
This control does not properly respond to this message.
For vertical scroll bar presence I retrieved the ListView per page count
with LVM_GETCOUNTPERPAGE and compared it to the total count in the list
view.
Using your code below and taking into account the scroll bar presence and
all the original colomn totalling logic I can somewhat accurately determine
both the full size of the control and the totalled components.
I now have to use all this information and combine it with all the column
resize hooking I did plus the mouse tracking.
Thanks Ken the following sample does clear up some of the gaps in my memory
on how some of this stuff works.
"Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eiEM7mOqFHA.1324@xxxxxxxxxxxxxxxxxxxxxxx
> "Dave" <KingOfTheBeach@xxxxxxxxxxxxxxxx> wrote in message
> news:uMRD2SOqFHA.712@xxxxxxxxxxxxxxxxxxxxxxx
> > Ken,
> >
> > Were you confirming my statement "Some controls like the Picture control
> > have Properties called Width and ScaleWidth, so if I cheated and used
the
> > delta between the picture controls width and scale width would that be a
> > reliable fudge factor to use in my calculations to accommodate for this
> > border width." ?
> >
> > Dave
>
> This looks pretty accurate. Basically, it's GetWindowRect - GetClientRect
> '===============
> Option Explicit
>
> Private Declare Function GetClientRect _
> Lib "user32.dll" (ByVal hwnd As Long _
> , ByRef lpRect As RECT) As Long
>
> Private Declare Function GetWindowRect _
> Lib "user32.dll" (ByVal hwnd As Long _
> , ByRef lpRect As RECT) As Long
>
> Private Type RECT
> Left As Long
> Top As Long
> Right As Long
> Bottom As Long
> End Type
>
>
> Private Sub Command1_Click()
> Dim r1 As RECT
> Dim r2 As RECT
>
> Call GetClientRect(ListView1.hwnd, r1)
> Call GetWindowRect(ListView1.hwnd, r2)
>
> 'Debug.Assert False
>
> With r2
> .Bottom = .Bottom - .Top
> .Right = .Right - .Left
> End With
>
> 'Shows 3 pixels per side difference (border single and 3d)
> 'Shows 1 pixel per side difference (border single and flat)
> 'Shows 0 pixels per side difference (border none and flat)
> Debug.Print r2.Right, r1.Right, r2.Right - r1.Right
> Debug.Print r2.Bottom, r1.Bottom, r2.Bottom - r1.Bottom
>
> Debug.Assert False 'stops here (for setting a watch/etc)
>
> End Sub
> '===============
>
> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
> Please keep all discussions in the groups..
>
>
.
- Follow-Ups:
- Re: ListView Column Resize
- From: Ken Halter
- Re: ListView Column Resize
- References:
- Re: ListView Column Resize
- From: Ken Halter
- Re: ListView Column Resize
- From: Dave
- Re: ListView Column Resize
- From: Ken Halter
- Re: ListView Column Resize
- From: Dave
- Re: ListView Column Resize
- From: Ken Halter
- Re: ListView Column Resize
- Prev by Date: Re: question about controls: which one I have to choose for this?
- Next by Date: Re: Transparent Toolbar Icons
- Previous by thread: Re: ListView Column Resize
- Next by thread: Re: ListView Column Resize
- Index(es):
Relevant Pages
|
Loading