CommonControls (Replacement of the MS common controls) - Page 48-VBForums
Page 48 of 48 FirstFirst ... 3845464748
Results 1,881 to 1,912 of 1912

Thread: CommonControls (Replacement of the MS common controls)

  1. #1881

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    And this makes trouble.
    If I set Cancel to true, then I can't select a tab at all.
    I could manage the Cancel value, but I think this is not a good approach.
    When you select the Tab during MouseUp you Need to flag an private variable (form variable) so during that selection you do not set Cancel to True in the TabBeforeClick Event.
    I think the event will also be fired when you Change the tab by code. So in that exception you need to by-pass it once.

  2. #1882
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    286

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    When you select the Tab during MouseUp you Need to flag an private variable (form variable) so during that selection you do not set Cancel to True in the TabBeforeClick Event.
    I think the event will also be fired when you Change the tab by code. So in that exception you need to by-pass it once.
    That what I meant by "I could manage the Cancel value, but I think this is not a good approach.".
    It works in this special case of course.

    When I make it like this, I must set the variable on every single .Selected call.
    And reset it afterwards.
    Ok, this can be made.

    But for scrolling through the tabs by wheel, this approach fails.
    Cancel is true, so scrolling doesn't work.
    As there is no Scroll events, I can't do anything.

    And it is not a solution to set the variable on MouseDown.
    If no MouseUp happens, then I'm lost.
    MouseEnter/Leave both don't fire, so no chance to reset (while this wouldn't be reliable in this case anyway).

    Again see attached sample.
    Tbs2.zip

    Any better idea? Or I hint on what I'm overlooking?

    EDIT:
    I tried several apps to see how they react on MouseDown on a tab.
    They all switch the tab immediately on MouseDown, and not on MouseUp.
    So what we find in VBCCR is a correct behavior.

    But I don't like it so much.
    The Tab control seems to be the only control that doesn't behave like all other controls.

    If the workarounds are too much effort, then I fear I have to live with the standard.
    Last edited by Karl77; Jan 4th, 2018 at 07:36 AM.

  3. #1883

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    MouseEnter/Leave both don't fire, so no chance to reset (while this wouldn't be reliable in this case anyway).
    They fire only when the MouseTrack property is set to True.

  4. #1884
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    286

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    They fire only when the MouseTrack property is set to True.
    Thanks for the hint!

    Anyway, I now decided to accept the immediate action on MouseDown.
    It doesn't make sense to make non-standard solutions.

  5. #1885
    Member
    Join Date
    Jul 2016
    Posts
    39

    Re: CommonControls (Replacement of the MS common controls)

    Hello

    There are no installation instructions and no clear download link.
    At design time (IDE) there is only one dependency. (OLEGuids.tlb)
    That means I'm looking for a file called "OLEGuids.tlb", nothing more.

    The first post states:
    List of revisions
    21-Dec-2017
    - Improved the WM_MOUSEWHEEL handler for fine-grained wheel changes in the TabStrip, MonthView and DTPicker control.
    I see no "Download" link. The only way to get the file seems to be through GitHub, but VBCCR/Standard EXE Version/OLEGuids/OLEGuids.tlb was last updated on 18 November 2017.

    How is one supposed to get the latest version of this CommonControls library?
    Last edited by OldClock; Jan 8th, 2018 at 05:17 PM.

  6. #1886
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,684

    Re: CommonControls (Replacement of the MS common controls)

    the project download is at the bottom of the first post. If you have issues setting up the project, you can just download the already compiled ocx from this thread. also at the bottom of the OCX threads post.

    see here --> http://www.vbforums.com/showthread.p...on-controls%29

    download the VBCCR15.OCX.rar.docx file, and rename it to VBCCR15.OCX.rar
    extract the rar, to a folder using winzip/winrar or 7zip.
    copy the VBCCR15.OCX to a permanent location like syswow64. and register it there.
    (open a admin commandline, and run regsvr32.exe VBCCR15.OCX /register from syswow64)
    Last edited by DEXWERX; Jan 9th, 2018 at 12:51 PM.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  7. #1887
    Member
    Join Date
    Jul 2016
    Posts
    39

    Re: CommonControls (Replacement of the MS common controls)

    1. Why not write clear installation instructions in the first post?
    2. Why not offer a clear download link for the "only one dependency", "OLEGuids.tlb"?
    Last edited by OldClock; Jan 9th, 2018 at 04:52 AM.

  8. #1888
    Member
    Join Date
    Jul 2016
    Posts
    39

    Re: CommonControls (Replacement of the MS common controls)

    Thank you for the reply DEXWERX. I checked the attachments to the first post of the EXE version. The only attachment visible to me is "ComCtlsDemo.zip.docx". It contains "OLEGuids.tlb" from 2017-06-09. How does one get the "leading source" EXE version from 21-Dec-2017?

  9. #1889
    Member
    Join Date
    Jul 2016
    Posts
    39

    Re: CommonControls (Replacement of the MS common controls)

    In the meanwhile I'm trying to use the Slider widget in an existing project. I've copied OLEGuids.tlb from 21-Dec-2017 into the system folder, and added a reference to it. Nothing new appeared in the toolbox, so I clicked Project > Add User Control > Existing, selected ComCtlsDemo/Builds/Slider/Slider.ctl. It appears in the toolbox. However, when I try to place it in a form, I get an error: "User-defined type not defined" from
    Code:
    Private PropRightToLeftMode As CCRightToLeftModeConstants
    So I grepped and found that that probably comes from Builds/ComCtlsBase.bas, so I added that module, tried again, and, user-defined type not defined:
    Code:
    Public Sub ComCtlsSetSubclass(ByVal hWnd As Long, ByVal This As ISubclass, ByVal dwRefData As Long, Optional ByVal Name As String)
    Found it in Builds\ISubclass.cls, so I added that, tried again, fail again with "DPICorrectionFactor"...

    Surely this brute-force head-banging is not the correct procedure for adding a widget to an existing project... But I see no installation instructions. What am I missing?

  10. #1890

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    OldClock,

    It seems you don't understand the concept of the Std-EXE version.

    That's why I advise you to just use the OCX version.
    When you read the first post carefully you will find a link to the OCX.

  11. #1891
    Member
    Join Date
    Jul 2016
    Posts
    39

    Re: CommonControls (Replacement of the MS common controls)

    By explaining the issues a new user to your custom controls such as myself encounters I was hoping the situation could be improved for everyone - by browsing through these 48 pages I see I'm not alone.
    I raised some issues already in September last year - none of them were addressed. There still are no clear installation instructions for incorporating these custom controls in an existing project and in a new project, no clear licencing, no clear download link. When one is involved with something for a long time, one becomes blinded to how it appears from the outside; I think that may the the case here. For example someone trying to find what licence this whole thing is under will not find that information in the standard place - a "LICENCE" text file is not bundled with the project and is not to be found on the GitHub page, it does not exist. Only through luck would one find "no license, free" on page 42 of this forum. It reminds me of H2G2,
    "But the plans were on display . . ."
    - "On display? I eventually had to go down to the cellar to find them."
    "That's the display department."
    - "With a torch."
    "Ah, well the lights had probably gone."
    - "So had the stairs."
    "But look, you found the notice, didn't you?"
    - "Yes," said Arthur, "yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying Beware of the Leopard."
    OldClock,
    It seems you don't understand the concept of the Std-EXE version.
    Maybe I don't.
    At design time (IDE) there is only one dependency. (OLEGuids.tlb)
    This is a modified version of the original .tlb from the vbaccelerator website.
    But for the compiled .exe there are no dependencies, because the .tlb gets then compiled into the executable.
    Everything should be self explained, because all functions and properties have a description.
    Having everything compiled into the EXE is what I want. If I missed the concept, would you explain it better?

    I verbosely explained the issues in this and previous posts in hopes that these issues can be addressed properly, for everyone's benefit.

  12. #1892
    Fanatic Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    930

    Re: CommonControls (Replacement of the MS common controls)

    Hey OldClock - why so rude and demanding? Please don't forget that Krool is donating his time to this project, offering it all 100% free of charge. Yes it would be splendid if he spent even more time putting it all together in a perfect professional package with polished documentation, but that's a lot to just demand or expect from a volunteer.

    You've identified a pain point, so maybe this would be a good thing to contribute back once you've worked out the details? You know, for everyone's benefit

  13. #1893
    Member
    Join Date
    Jul 2016
    Posts
    39

    Re: CommonControls (Replacement of the MS common controls)

    jpbro:
    1. I disagree about rude. It takes time to point out issues clearly, and instead of acknowledging the problem, I received "It seems you don't understand the concept of the Std-EXE version" in reply. As I admitted, perhaps I don't, but that means the concept can be explained more clearly.
    2. Demanding - I'm pointing this out for my own selfish needs as well as for every other layman's benefit. I'm not asking for much either. A project that's been going of for many years is shooting itself in the foot if it doesn't explain the basics to attract more users, testers and potential developers - in that order.
    3. I've been heavily involved in open-source for the last 10 years and am quite familiar with how it works. I can't give back before I understand anything about this.

  14. #1894
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,684

    Re: CommonControls (Replacement of the MS common controls)

    I understand your frustration. It's difficult to jump into a complex project as a beginner.

    Some helpful info:
    A typelib is a binary file that defines types, object interfaces, and more specific API definitions needed for COM interop / marshalling (and VB)
    There is no code in it per-se, just a set of definitions needed to interact with certain APIs. So you won't find any controls in a type library.

    They can be embedded in an ActiveX DLL or OCX, or as standalone .TLB files, and they are installed similarly using REGTLIB.EXE

    So plop the typelib in a good spot - and browse to it under references to add it to your project.

    Like jp said - Write down the steps you take to get the standard exe going and paste the instructions here, so you can help other beginners figure it out too.

    Word of caution though - the standard exe project can be difficult to work with for developers that don't already have the pre-req knowledge of
    1) building user controls in VB
    2) COM/typelibs/ActiveX Dlls
    3) Win32 API, Subclassing, Windows Common Controls

    Feel free to ask specific questions - there are plenty of people here other than KROOL that are willing to help out. That's the beauty of open source.


    edit: another tip - There are many dependencies for the controls - and they are all packaged nicely in the OCX version.
    If you are trying to use just a couple controls of the EXE project - start by getting the EXE project going, and then removing all the pieces you don't need.
    Spend some time figuring out the dependencies before you go and try adding stuff piecemeal to another project.
    Last edited by DEXWERX; Jan 9th, 2018 at 01:02 PM.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  15. #1895
    Fanatic Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    930

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    jpbro:
    1. I disagree about rude.
    We'll have to agree to disagree about this one.

    I haven't really used Krool's controls much so I may be wrong about the following, but I just tried getting a "minimal" project together to use a subset of the controls without requiring the OCX as follows:

    1. Download the latest source code from GitHub as a ZIP file.
    2. Extract the Standard EXE Version folder.
    3. Start a new VB EXE project.
    4. Rename Form1 to MainForm
    5. Click the Project menu, then click References. The References window appears.
    6. Click the Browse button.
    7. Navigate to the Standard EXE Version fodler that was extracted in Step #2, then navigate to the OLEGuids subfolder and select the OLEGuids.tlb file and click Open.
    8. Back on the References window, click OK.
    9. Add all of the files from the Standard EXE Version\Common folder to the project.
    10. Add all of the files from the Standard EXE Version\Builds folder to the project (not all of the files from the subfolders, just the BAS/CLS files in the Builds folder).
    11. Add the individual UserControls from the various Builds subfolders that I want to be part of my EXE (for example, to add the ComboBoxW control, add the ComboBoxW.ctl file from the Standard Exe Version\Builds\ComboBoxW folder to the project).


    From there I added a control to MainForm and it seemed to get sited, compile, and run fine. Again, I haven't done this before so I may have made mistakes (or added more files than necessary), but the above should be a good place to start.

  16. #1896
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,684

    Re: CommonControls (Replacement of the MS common controls)

    I love that these projects are on github now. It's cool to see someone submit a fix (for the flexgrid) and see what was fixed.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  17. #1897
    Addicted Member
    Join Date
    Feb 2014
    Posts
    225

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool,

    If LabelW is inside FrameW, the LabelW_Click() event does not fire.

    I experimented with the "old" FrameW (before 3-Jul-2017 version), it works.

  18. #1898
    Addicted Member
    Join Date
    Feb 2014
    Posts
    225

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool,

    Ref attached screenshot.

    I am converting a more than 10 year old app to use your controls. The screenshot show a MDI child window which is normally used to show a chart on a picturebox. During the occasional optimization process, the chart will be cleared using .cls. On every iteration/permutation, .cls again and the running updated optimization information are re-printed using .CurrentX, .CurrentY and .Print. This repeats until the last iteration/permutation.

    This process can be aborted anytime with the Abort button. Using the VB6 commandbutton, it stay on the window. When I use CommandButtonW, it won't show. However, when I resize the window, it will show and then sometime flicker on and off and disappear.

    It is not really a problem because for this one button I can use the VB6's. But if there is some thing I can do, I rather use your CommandButtonW.
    Attached Images Attached Images  
    Last edited by chosk; Jan 10th, 2018 at 06:37 AM. Reason: For clearer explanation

  19. #1899

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by chosk View Post
    Hi Krool,

    If LabelW is inside FrameW, the LabelW_Click() event does not fire.

    I experimented with the "old" FrameW (before 3-Jul-2017 version), it works.
    For some odd reason the HelpContext features/properties are only available when the UC's CanGetFocus is True.
    So in order to not gain focus in the FrameW the WM_MOUSEACTIVATE is handled.
    And that also avoid clicking on a windowless Label control...
    Solution would be to put a Picturebox above the FrameW and the Label on the Picturebox.
    Other solution would be to discard WM_MOUSEACTIVATE and put CanGetFocus to False, but that's not recommended due to loss of help features.
    Sorry..

  20. #1900
    Addicted Member
    Join Date
    Feb 2014
    Posts
    225

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool,

    Thanks.

    No problem. I can use the old FrameW.

    Edit:
    I decided to use a CommandButtonW instead of the LabelW
    Last edited by chosk; Jan 10th, 2018 at 08:08 AM. Reason: update

  21. #1901

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by chosk View Post
    No problem. I can use the old FrameW.
    Hmm. I have found an solution, but I think it is not the "cleanest" way, or is it? Maybe somebody can advise. (?)

    So instead of
    Code:
    Private Function WindowProcUserControl(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    If wMsg = WM_MOUSEACTIVATE Then
        Dim Pos As Long
        Pos = GetMessagePos()
        If WindowFromPoint(Get_X_lParam(Pos), Get_Y_lParam(Pos)) = hWnd Then
            WindowProcUserControl = MA_NOACTIVATEANDEAT
            Exit Function
        End If
    I would use then
    Code:
    Private Function WindowProcUserControl(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    If wMsg = WM_SETFOCUS Then
        SetFocusAPI wParam
        Exit Function
    to avoid getting the Focus by mouse click. So any Label control would receive it's mouse clicks.
    The tabbing is already avoided by applying TabStop = False on FrameW startup.

  22. #1902
    Junior Member
    Join Date
    Oct 2016
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    oldclock.

    krool has invested a lot of time in designing these controls, and many others have added a lot of comments to help this project, we are all so thankful, and we feel that criticism can only jeopardise this beautiful project.


    having said that, with krools permission, I would be glad to write a post with all the proper links to download and install the ocx (exe version and ocx version)

    do you agree for me to do it, krool?

    thanks krool , I use you stuff all the time..

  23. #1903

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    do you agree for me to do it, krool?
    Yes, please. Thanks a lot.

  24. #1904
    New Member
    Join Date
    Nov 2017
    Posts
    3

    Re: CommonControls (Replacement of the MS common controls)

    Yes, what Semke said!!!!! ("Krool has invested a lot of time in designing these controls, and many others have added a lot of comments to help this project, we are all so thankful, and we feel that criticism can only jeopardise this beautiful project.") .............. Thank you Krool

  25. #1905
    Member
    Join Date
    Jul 2016
    Posts
    39

    Re: CommonControls (Replacement of the MS common controls)

    Quite the opposite. Constructive criticism leads to improvements.

  26. #1906
    Junior Member
    Join Date
    Oct 2016
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    The .docx extension was necessary so it could be uploaded. (there is a file limit of 500 KB without .docx extension)
    OCX Source (includes a Compiled OCX)
    EXE-Version Only Source

    If you would like to open the source code in Visual Basic, you will need to register OLEGuids.tlb which is in the OLEGuids Folder in the zip file, this is an updated type library with classes required for this project
    Last edited by Semke; Jan 11th, 2018 at 05:38 AM.

  27. #1907
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,684

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    Quite the opposite. Constructive criticism leads to improvements.
    Constructive criticism would come across much better with a little humility.
    Especially when you don't know what a typelib, or a manifest, or a resource file is.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  28. #1908
    Fanatic Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    930

    Re: CommonControls (Replacement of the MS common controls)

    Agreed @Dexwerx...sometimes it's not the message, it's the delivery.

  29. #1909

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    I think I will revert in the FrameW control back to CanGetFocus = False and thus loosing the HelpContextID feature but gaining the mouse clicks. (both label, or windowless controls on container, and frame itself)
    I would consider that more important than an obselete HelpContextID for this case.
    If somebody uses HelpContextID for an old app, than the Frame control might stay with the VB.Frame then.. any comments concerning this before I suceed? Schmidt?

  30. #1910

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Quote Originally Posted by chosk View Post
    If LabelW is inside FrameW, the LabelW_Click() event does not fire.
    This point got me so annoyed. The own MouseDown or Click event of the FrameW is not firing and of course not any placed windowless controls on it, as for instance a LabelW control.

    So I switched back and turned off again CanGetFocus to False and made some other minor modifications related to that.
    Now you can click on it and get all your events and of course it won't receive focus.
    But, as already warned, this has been done in the expense of the HelpContextID support. However, I will stick with this solution as of now.. When somebody complaints about HelpContextID then I want an advise of how to resolve both. Or just simply switch to VB.Frame when really HelpContextID is needed.

    The OCX has also been updated now in 1.5. However, in order to not wait until 1.6 I needed to "ghost" the HelpContextID property. (remove was not allowed in order to maintain binary compatibility)
    Code:
    Public Property Get HelpContextID() As Long
    ' HelpContextID = Extender.HelpContextID
    End Property
    
    Public Property Let HelpContextID(ByVal Value As Long)
    ' Extender.HelpContextID = Value
    End Property

  31. #1911
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    286

    Re: CommonControls (Replacement of the MS common controls)

    OPTIONBUTTONW PROBLEM

    OptionButtonW fires 1 event too much on a mouseclick.
    See attached:
    Option.zip

    OptionButtonW1(0).Value = True after Form_Load.

    When I click OptionButtonW1(1), I get 2 click events.
    1x from OptionButtonW1(0): Value = False
    1x from OptionButtonW1(1): Value = True

    The intrinsic control doesn't show this behavior.

    ---

    EDIT:
    I know it's easy to workaround this.
    As I would have to do this in many distributed places, I mentioned it here.
    Last edited by Karl77; Jan 16th, 2018 at 04:15 AM.

  32. #1912

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    897

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Quote Originally Posted by Karl77 View Post
    OPTIONBUTTONW PROBLEM

    OptionButtonW fires 1 event too much on a mouseclick.
    Good catch, solved. Thanks

Page 48 of 48 FirstFirst ... 3845464748

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.