Page 74 of 94 FirstFirst ... 24647172737475767784 ... LastLast
Results 2,921 to 2,960 of 3726

Thread: CommonControls (Replacement of the MS common controls)

  1. #2921

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Krool, please help me figure out how the ListBackColor and IntegralHeight properties work. I tried to use them with different operating systems and with different font sizes. There were no effect.
    The ListBackColor is only in effect when the UseListBackColor property is set to True. (will return list back color brush on WM_CTLCOLORLISTBOX only when UseListBackColor is True, default is False)

    What you mean with IntegralHeight ?
    I think you mix up things. MSDN says about CBS_NOINTEGRALHEIGHT (equivalent of .IntegralHeight = False then CBS_NOINTEGRALHEIGHT is set)
    Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, the system sizes a combo box so that it does not display partial items.
    That means the Height (!) of the drop-down list box area, not the width.

    If you want to have the big size text fit into the drop-down area then try:
    A) .HorizontalExtent = .GetIdealHorizontalExtent()
    B) .DropDownWidth = .GetIdealHorizontalExtent() + Me.ScaleX(4, vbPixels, Me.ScaleMode) ' small extra buffer to account border widths etc.

    Option A) uses CB_SETHORIZONTALEXTEND API.
    MSDN: If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box. If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden or, if the combo box has the CBS_DISABLENOSCROLL style, disabled.
    You can use the .DisableNoScroll property to control whether CBS_DISABLENOSCROL is set or not.

    Option B) uses CB_SETDROPPEDWIDTH API.
    MSDN: By default, the minimum allowable width of the drop-down list box is zero. The width of the list box is either the minimum allowable width or the combo box width, whichever is larger.

    The .GetIdealHorizontalExtent() function is a convenient wrapper which calculates the "best" width, accounting possible WS_VSCROLL style and testing the string widths using the selected font.
    Last edited by Krool; Sep 13th, 2020 at 08:06 AM.

  2. #2922
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Arrow Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    What you mean with IntegralHeight ?
    I think you mix up things. MSDN says about CBS_NOINTEGRALHEIGHT (equivalent of .IntegralHeight = False then CBS_NOINTEGRALHEIGHT is set)
    Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, the system sizes a combo box so that it does not display partial items.
    That means the Height (!) of the drop-down list box area, not the width.
    Krool, thanks for the detailed answer. I really mixed things up, and you helped me figure it out. But now I still want to understand how the standard IntegralHeight property works

    For example, when I increase the .Font.Size at runtime, the .Height also increases. This is independent of the .IntegralHeight value. How can I see the "partial items"?

  3. #2923
    Addicted Member
    Join Date
    Mar 2009
    Posts
    244

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Krool, thanks for the detailed answer. I really mixed things up, and you helped me figure it out. But now I still want to understand how the standard IntegralHeight property works

    For example, when I increase the .Font.Size at runtime, the .Height also increases. This is independent of the .IntegralHeight value. How can I see the "partial items"?
    IntegralHeight set to True just makes sure the items are completely visible, so the Height is always 'rounded' to a full item visible, so if you increase the size of the font it will adjust the height with it. Set it to False if you don't want that, the Height will be as you've set it.

  4. #2924
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by SuperDre View Post
    Set it to False if you don't want that, the Height will be as you've set it.
    I thought so. But it just doesn't work this way.

  5. #2925
    Addicted Member
    Join Date
    Mar 2009
    Posts
    244

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    I thought so. But it just doesn't work this way.
    Oh, you're talking about the combobox? sorry I only thought about the listbox. As far as I know, the combobox is always integral height, just like it also doesn't seem to acknowledge 3D on/off (at least not with the standard VB version).

  6. #2926
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by SuperDre View Post
    Oh, you're talking about the combobox? sorry I only thought about the listbox. As far as I know, the combobox is always integral height, just like it also doesn't seem to acknowledge 3D on/off (at least not with the standard VB version).
    But the property is exist. Let's wait for the Krool's answer.

  7. #2927
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Lightbulb Re: CommonControls (Replacement of the MS common controls)

    If it is possible, It would be great to add a LimitToList property to the ComboBoxW control like in Microsoft Access.

    https://docs.microsoft.com/en-us/off...ox.limittolist

  8. #2928
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    But the property is exist. Let's wait for the Krool's answer.
    Depends on the combobox style. Only one of the styles supports IntegralHeight=False.
    As for the LimitToList of Access? Isn't that what combobox Style 2 is?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  9. #2929
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    Depends on the combobox style. Only one of the styles supports IntegralHeight=False.
    Are you talking about SimpleCombo style? Without any list at all?


    Quote Originally Posted by LaVolpe View Post
    As for the LimitToList of Access? Isn't that what combobox Style 2 is?
    I usually use Style 2. Style 0 is more flexible (you can make it autofill aware or filter the list during user typing), but user can put there any garbage and leave the control.

  10. #2930
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: CommonControls (Replacement of the MS common controls)

    No, style 1. Try it. Set IntegralHeight = False, increase the size of the comboxbox in design. In form load, add your items, you'll notice partial items are shown. Style 1 is like a hybrid comboxbox + listbox.

    With Krool's control, you can turn AutoSelect on (Style 0) which will update the ListIndex property if the user selected something in the list, ListIndex is not -1 else it is -1. Check that property.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  11. #2931
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    No, style 1. Try it. Set IntegralHeight = False, increase the size of the comboxbox in design. In form load, add your items, you'll notice partial items are shown. Style 1 is like a hybrid comboxbox + listbox.
    Thank you! Yes, the last item is partial. The ItemHeight property allows me to see all "partial items".

    Quote Originally Posted by LaVolpe View Post
    With Krool's control, you can turn AutoSelect on (Style 0) which will update the ListIndex property if the user selected something in the list, ListIndex is not -1 else it is -1. Check that property.
    Selecting something in the list manualy is not realy the AutoSelect. User can leave the control without any clicking.
    Last edited by Nouyana; Sep 15th, 2020 at 08:37 AM.

  12. #2932
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    I edited my previous post. We just posted them at the same time.

  13. #2933
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Selecting something in the list manualy is not realy the AutoSelect. User can leave the control without any clicking.
    That's why you have a LostFocus and Validate event. Use it.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  14. #2934
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    That's why you have a LostFocus and Validate event. Use it.
    I just suggested. This property is almost always used in Access.

  15. #2935
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Krool, why the AutoSelect property of ComboBox doesn't work when the control isn't dropped down? Was it intended?

  16. #2936
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Lightbulb Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    That's why you have a LostFocus and Validate event. Use it.
    Maybe you are right. We have a FindItem property in the ComboBoxW control. Thus, the Validate subroutine may look very short:

    VB Code:
    1. Private Sub ComboBoxW1_Validate(Cancel As Boolean)
    2.    With ComboBoxW1
    3.       If .FindItem(.Text) = -1 Then Cancel = True
    4.    End With
    5. End Sub

  17. #2937
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Question Re: CommonControls (Replacement of the MS common controls)

    Can anyone please explain what the PictureAndCaption property is for? Under Windows XP without comctl32.dll v.6.1 everything works fine without this property.
    Attached Images Attached Images  

  18. #2938

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Can anyone please explain what the PictureAndCaption property is for? Under Windows XP without comctl32.dll v.6.1 everything works fine without this property.
    The PictureAndCaption property is meaningful only when the style property is 0 - Normal.

  19. #2939
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The PictureAndCaption property is meaningful only when the style property is 0 - Normal.
    Thank you. When can this be useful? Why not just use style 2?

  20. #2940
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Thank you. When can this be useful? Why not just use style 2?
    I meant style 1, of course.

  21. #2941
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Exclamation Re: CommonControls (Replacement of the MS common controls)

    Error with TextBoxW.OverTypeMode property

    Name:  OverTypeMode.gif
Views: 1158
Size:  8.5 KB

  22. #2942

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Error with TextBoxW.OverTypeMode property

    Name:  OverTypeMode.gif
Views: 1158
Size:  8.5 KB
    I cannot replicate your problem. I just tested AllowOverType property (which toggles OverTypeMode property upon Insert key) and it worked.

    Please bundle a demo showing the issue. Thanks

    Quote Originally Posted by Nouyana View Post
    When can this be useful? Why not just use style 1?
    Style 1 - Graphical implies the BS_OWNERDRAW window style. It's just another possibility to have picture and caption without depending on BS_OWNERDRAW.

    Quote Originally Posted by Nouyana View Post
    why the AutoSelect property of ComboBox doesn't work when the control isn't dropped down? Was it intended?
    I don't know what you mean exactly. When I set the ComboBoxW1 style to 0 - DropDownCombo in the ComCtlsDemo project and I type 'charlie' it automatically becomes 'Charlie' without using the dropdown. So for me it is working. (the ListIndex is updated)
    Again please provide demo so I can look what the problem is.
    Last edited by Krool; Sep 20th, 2020 at 12:30 PM.

  23. #2943
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Arrow Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    I don't know what you mean exactly. When I set the ComboBoxW1 style to 0 - DropDownCombo in the ComCtlsDemo project and I type 'charlie' it automatically becomes 'Charlie' without using the dropdown. So for me it is working. (the ListIndex is updated)
    Again please provide demo so I can look what the problem is.
    I have tested the AutoSelect property under:
    1. WinXP SP3 with comctl32.dll versions 5.82.2900.6028 and 6.0.2600.0
    2. Win10 x64
    It was ComCtlsDemo project from v1.7.0.0

    I tried two experiments. The first one:
    1. I made the ComboBoxW1 dropped down (style 0)
    2. I typed "char" in the text field of ComboBoxW1
    3. I pressed the Tab key on my keyboard
    4. The text field was filled automatically and the ListIndex was updated

    The second experiment:
    1. I made the ComboBoxW1 closed up (style 0)
    2. I typed "charlie" in the text field of ComboBoxW1
    3. I pressed the Tab key on my keyboard
    4. The text field was NOT changed automatically and the ListIndex = -1

    Name:  AutoSelect.jpg
Views: 1408
Size:  60.8 KB

    Quote Originally Posted by Krool View Post
    I cannot replicate your problem. I just tested AllowOverType property (which toggles OverTypeMode property upon Insert key) and it worked.
    Please bundle a demo showing the issue. Thanks.
    Here it is. Tested under WinXP SP3 with comctl32.dll version 5.82.2900.6028
    CCRP v1.7.0.0

    OverTypeMode.zip
    Last edited by Nouyana; Sep 20th, 2020 at 11:17 PM.

  24. #2944

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    I have tested the AutoSelect property under:
    1. WinXP SP3 with comctl32.dll versions 5.82.2900.6028 and 6.0.2600.0
    2. Win10 x64
    It was ComCtlsDemo project from v1.7.0.0

    I tried two experiments. The first one:
    1. I made the ComboBoxW1 dropped down (style 0)
    2. I typed "char" in the text field of ComboBoxW1
    3. I pressed the Tab key on my keyboard
    4. The text field was filled automatically and the ListIndex was updated

    The second experiment:
    1. I made the ComboBoxW1 closed up (style 0)
    2. I typed "charlie" in the text field of ComboBoxW1
    3. I pressed the Tab key on my keyboard
    4. The text field was NOT changed automatically and the ListIndex = -1
    The ComboBoxW1 in the ComCtlsDemo project has AutoSelect property as False. Please ensure to set it to True.

    Quote Originally Posted by Nouyana View Post
    Here it is. Tested under WinXP SP3 with comctl32.dll version 5.82.2900.6028
    CCRP v1.7.0.0

    OverTypeMode.zip
    I could replicate it on Windows XP, but not on Windows 10.
    The root cause is that there is an access violation when the edit control receives EM_REPLACESEL with a null pointer.
    The RichEdit control does not crash with a null pointer and EM_REPLACESEL.

    My guess is that after Windows XP there was a fix so that a null pointer in EM_REPLACESEL does not crash anymore the edit control.
    I have noted this down and will probably soon make a fix that kinda looks like following for the SelText property:
    Code:
    If StrPtr(Value) = 0 Then Value = ""
    Last edited by Krool; Sep 21st, 2020 at 10:31 AM.

  25. #2945
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Arrow Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The ComboBoxW1 in the ComCtlsDemo project has AutoSelect property as False. Please ensure to set it to True.
    Oh, yes. You are right. I forgot it. But the problem is exist. When you type "charlie", it becomes "Charlie". But when you type "char", the behavior depends on the DroppedDown state. As I understand, this is not the problem of AutoSelect property. It would be nice if "Char" always became "Charlie".
    Last edited by Nouyana; Sep 21st, 2020 at 02:29 PM.

  26. #2946

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Oh, yes. You are right. I forgot it. But the problem is exist. When you type "charlie", it becomes "Charlie". But when you type "char", the behavior depends on the DroppedDown state. As I understand, this is not the problem of AutoSelect property. It would be nice if "Char" always became "Charlie".
    In a dropped down state the additional search kicks in by windows.
    So all normal and no issue here.

  27. #2947

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    I could replicate it on Windows XP, but not on Windows 10.
    The root cause is that there is an access violation when the edit control receives EM_REPLACESEL with a null pointer.
    The RichEdit control does not crash with a null pointer and EM_REPLACESEL.

    My guess is that after Windows XP there was a fix so that a null pointer in EM_REPLACESEL does not crash anymore the edit control.
    I have noted this down and will probably soon make a fix that kinda looks like following for the SelText property:
    Code:
    If StrPtr(Value) = 0 Then Value = ""
    I quote myself now.. This fix has been applied now.

  28. #2948
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: CommonControls (Replacement of the MS common controls)

    Krool, how does the FontCombo.BuddyControl property work? What kind of control should I use with this property?

  29. #2949

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    Krool, how does the FontCombo.BuddyControl property work? What kind of control should I use with this property?
    The FontCombo.BuddyControl can only buddy another FontCombo control.
    Means the first one has the font names and the buddied second One FontCombo the font sizes respectively.

  30. #2950
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Resolved Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The FontCombo.BuddyControl can only buddy another FontCombo control.
    Means the first one has the font names and the buddied second One FontCombo the font sizes respectively.
    Thanks!

  31. #2951
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Question Re: CommonControls (Replacement of the MS common controls)

    What about the VBFlexGrid.HitTest? This is a Sub, not a Function. But it should "return a value which indicates the element located at the specified X and Y coordinates."

    The same question about the ComputeControlSize method of the ListView and MonthView controls.
    Last edited by Nouyana; Sep 28th, 2020 at 07:44 AM. Reason: Added

  32. #2952

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    What about the VBFlexGrid.HitTest? This is a Sub, not a Function. But it should "return a value which indicates the element located at the specified X and Y coordinates."

    The same question about the ComputeControlSize method of the ListView and MonthView controls.
    VBFlexGrid.HitTest is a Sub. The return values are stored as property .HitResult/.HitRow/.HitCol.

    ComputeControlSize is also a Sub. The params are passed ByRef. So use variables.

  33. #2953
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    679

    Re: CommonControls (Replacement of the MS common controls)

    I don't know is this intended or not behaviour, but...
    Monthview does not refresh correctly, when multiple months are shown and selection extends to month(s) over leftmost month, which are not shown after mouseleave event.

    Select range extending to second and or third month displayed.
    After MouseLeave and MouseEnter events, monthview draws only leftmost month date range selection.
    Attached Files Attached Files

  34. #2954
    Lively Member vbLewis's Avatar
    Join Date
    Feb 2009
    Location
    USA
    Posts
    126

    Re: CommonControls (Replacement of the MS common controls)

    Krool, Im adding column headers and then items to the listview in report mode on form load. Im getting a Itemclick then an ItemSelect event as the first listItem is added before any following columns are even filled out or the listview is visible or the form is fully loaded. This makes my click and select code fail because of incomplete information. Is this a bug or intended behavior? I can set a flag to delay processing till initial load is done if needed but was curious...

  35. #2955
    Fanatic Member
    Join Date
    Jan 2016
    Posts
    753

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool
    My question is about DTPicker

    I want to know if possible to automatically move to next datepart.
    I mean selection focus moves to months (mm) after having entered the the days (dd).
    And move to the year(yyyy) part once the month is entered or vice versa.
    thank you
    Last edited by Mustaphi; Oct 15th, 2020 at 03:45 AM.

  36. #2956

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by vbLewis View Post
    Krool, Im adding column headers and then items to the listview in report mode on form load. Im getting a Itemclick then an ItemSelect event as the first listItem is added before any following columns are even filled out or the listview is visible or the form is fully loaded. This makes my click and select code fail because of incomplete information. Is this a bug or intended behavior? I can set a flag to delay processing till initial load is done if needed but was curious...
    The ItemSelect event is intended. The V6 MS.ListView behaves the same.
    However, the V5 MS.ListView behaves different.

    You can make the AutoSelectFirstItem property set to False (mimic V5 MS ListView behavior), then there will be no ItemSelect event fired when adding the first item. (but it is also not selected, only focused)

    The ItemClick event is not fired on my side. Can you share a demo showing this ? The ListView control only raises ItemClick upon NM_CLICK, NM_RCLICK. So this should not happen during the feed of a ListView. I cannot replicate that issue for you..

    Quote Originally Posted by Mustaphi View Post
    My question is about DTPicker

    I want to know if possible to automatically move to next datepart.
    I mean selection focus moves to months (mm) after having entered the the days (dd).
    And move to the year(yyyy) part once the month is entered or vice versa.
    thank you
    There is no straight forward dedicated message for that. However, you can trick the DTPicker in doing so.
    move focus to the right
    Code:
    SendMessage DTPicker1.hWnd, WM_KEYDOWN, vbKeyRight, ByVal 0&
    move focus to the left
    Code:
    SendMessage DTPicker1.hWnd, WM_KEYDOWN, vbKeyLeft, ByVal 0&
    Last edited by Krool; Oct 18th, 2020 at 05:49 AM.

  37. #2957
    Fanatic Member
    Join Date
    Jan 2016
    Posts
    753

    Re: CommonControls (Replacement of the MS common controls)

    you can trick the DTPicker in doing so
    I tested the trick but with no success
    I used the code in change event and in key down event but it did not work as expected.
    Anyway thank you very much

  38. #2958
    Lively Member vbLewis's Avatar
    Join Date
    Feb 2009
    Location
    USA
    Posts
    126

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The ItemSelect event is intended. The V6 MS.ListView behaves the same.
    However, the V5 MS.ListView behaves different.

    You can make the AutoSelectFirstItem property set to False (mimic V5 MS ListView behavior), then there will be no ItemSelect event fired when adding the first item. (but it is also not selected, only focused)

    The ItemClick event is not fired on my side. Can you share a demo showing this ? The ListView control only raises ItemClick upon NM_CLICK, NM_RCLICK. So this should not happen during the feed of a ListView. I cannot replicate that issue for you..
    Krool,
    Thanks for your reply. The AutoSelectFirstItem option fixed the problem. The reason i was also getting a Click event was because i was redirecting all Select() events to the Click() event. woops!
    regards,
    Lewis

  39. #2959
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Dark Mode question

    I have found a program which uses the windows common controls, and it can render them in other colors.
    As an example I see this with Spy++:
    Name:  28-10-_2020_09-12-31.jpg
Views: 829
Size:  39.2 KB

    So it _seems_ to be possible.
    Or am I wrong?

  40. #2960

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    Dark Mode question

    I have found a program which uses the windows common controls, and it can render them in other colors.
    As an example I see this with Spy++:
    Name:  28-10-_2020_09-12-31.jpg
Views: 829
Size:  39.2 KB

    So it _seems_ to be possible.
    Or am I wrong?
    If turning VisualStyles to False then you can define the BackColor property on the StatusBar control. No magic in this case.

Page 74 of 94 FirstFirst ... 24647172737475767784 ... LastLast

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