Results 1 to 40 of 4215

Thread: CommonControls (Replacement of the MS common controls)

Hybrid View

  1. #1
    Member lrd_VB6's Avatar
    Join Date
    Jul 2014
    Location
    FRANCE
    Posts
    36

    Re: CommonControls (Replacement of the MS common controls)

    Hello,

    happy to have made the project forward.

    Another little detail to "tease"
    In the following code:
    Code:
    If ImageListHandle = 0 Or (PropImageWidth = 0 Or PropImageHeight = 0) Then
            If PropImageWidth = 0 Then PropImageWidth = UserControl.ScaleX(Picture.Width, vbHimetric, vbPixels)
            If PropImageHeight = 0 Then PropImageHeight = UserControl.ScaleY(Picture.Height, vbHimetric, vbPixels)
            If ImageListHandle = 0 Then Call CreateImageList
    End If
    The first test is unnecessary.

    By cons, it is important to leave last
    If ImageListHandle = 0 Then Call CreateImageList

    Last, I'd like able to benefit from your internal routines to implement the subclassing by the method of your choice (usercontrol, class or other)
    To manage the mouse wheel by example.

    Good luck and thank you for your work.
    Last edited by lrd_VB6; Jul 21st, 2016 at 05:03 PM.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,742

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by lrd_VB6 View Post
    Another little detail to "tease"
    In the following code:
    Code:
    If ImageListHandle = 0 Or (PropImageWidth = 0 Or PropImageHeight = 0) Then
            If PropImageWidth = 0 Then PropImageWidth = UserControl.ScaleX(Picture.Width, vbHimetric, vbPixels)
            If PropImageHeight = 0 Then PropImageHeight = UserControl.ScaleY(Picture.Height, vbHimetric, vbPixels)
            If ImageListHandle = 0 Then Call CreateImageList
    End If
    The first test is unnecessary.

    By cons, it is important to leave last
    If ImageListHandle = 0 Then Call CreateImageList
    Done. Thanks.

    I also did another "tease". In the .ImageWidth and .ImageHeight property I replaced
    Code:
    If ImageListHandle <> 0 Then
        Call DestroyImageList
        Call CreateImageList
    End If
    with this
    Code:
    If ImageListHandle <> 0 Then Call DestroyImageList
    If ImageListHandle = 0 Then Call CreateImageList
    This ensures that the .hImageList will be valid when setting both .ImageWidth and .ImageHeight > 0.
    For the moment this was only the case when setting at design-time. Now it is the same at run-time.
    This can be important when setting the ImageList to a .ImageList property of a control prior loading the images!
    Anyhow, now it should be perfect and cover all cases.

    Quote Originally Posted by lrd_VB6 View Post
    Last, I'd like able to benefit from your internal routines to implement the subclassing by the method of your choice (usercontrol, class or other)
    To manage the mouse wheel by example.
    Please explain in more detail.

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