dcsimg
Page 57 of 57 FirstFirst ... 74754555657
Results 2,241 to 2,269 of 2269

Thread: CommonControls (Replacement of the MS common controls)

  1. #2241
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    429

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    But , About the issue related to VBCCR CommandButtons and TextBoxes hosted in a user control and being able to click the separately in design mode in IDE , it is the same
    I had the same problem a while ago, but it was solved some weeks ago for me.

    Could you post your project that shows the error?
    I would like to see if it happens here as well.

  2. #2242
    Addicted Member
    Join Date
    Aug 2016
    Posts
    165

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    I had the same problem a while ago, but it was solved some weeks ago for me.

    Could you post your project that shows the error?
    I would like to see if it happens here as well.
    a while ago is older or earlier than some weeks ago?

  3. #2243
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    429

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by DaveDavis View Post
    a while ago is older or earlier than some weeks ago?
    See post #2117.
    http://www.vbforums.com/showthread.p...=1#post5332087

  4. #2244
    Addicted Member
    Join Date
    Jul 2017
    Posts
    179

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    I had the same problem a while ago, but it was solved some weeks ago for me.

    Could you post your project that shows the error?
    I would like to see if it happens here as well.

    Thanks for your reply karl ,
    I will be wrapping a demo today attached with video as I am testing some scenarios now .

  5. #2245
    Addicted Member
    Join Date
    Jul 2017
    Posts
    179

    Re: CommonControls (Replacement of the MS common controls)

    I could reproduce the scenario which causes this problem and it is such a strange and tricky .

    https://www.youtube.com/watch?v=IaxZ...ature=youtu.be

    I was limited to 15 minutes of recording so , there is an uncompleted test result at the end of the video but it should be enough to make the point clear for now .

    Summary for video :

    The scenario :

    1- Add a new user control
    2- Place normal textbox or any VB6 intrinsic controls in the user control .
    3- Place any VBCCR control in the user control
    4- In the UserControl_Initialize event , add these lines of code .

    Lets say you used a VB intrinsic Textbox and a VBCCR CommandButtonW . Add these lines

    Code:
    text1.text="Hello"
    commandbuttonw1.caption ="Hello"
    5- The problem happens
    6 - Uncomment the code , The problem now disappears .
    7 - Put the following code in the same event
    Code:
    Dim s as string
    s= "Hello , I prove that not all code causes the problem , It is only for the code that draws an item in the user control"
    8 - With this previous case , the problem does not happen .

    More details and tests are found in the video for tests on the ComCtlsDemo project

    Thanks everybody for your help and sorry for bad English .
    Last edited by Hosam AL Dein; Mar 13th, 2019 at 04:48 PM.

  6. #2246
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    429

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    I could reproduce the scenario which causes this
    Easy to reproduce, and happens in here the same way.

    While the effect is bothering, it is more a cosmetic issue.
    I lived with it for a long time, and it didn't stopped me to get things done.

    But good to point out the issue!
    And I would appreciate a solution as well.

  7. #2247

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,222

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    I could reproduce the scenario which causes this problem and it is such a strange and tricky .

    https://www.youtube.com/watch?v=IaxZ...ature=youtu.be

    I was limited to 15 minutes of recording so , there is an uncompleted test result at the end of the video but it should be enough to make the point clear for now .

    Summary for video :

    The scenario :

    1- Add a new user control
    2- Place normal textbox or any VB6 intrinsic controls in the user control .
    3- Place any VBCCR control in the user control
    4- In the UserControl_Initialize event , add these lines of code .

    Lets say you used a VB intrinsic Textbox and a VBCCR CommandButtonW . Add these lines

    Code:
    text1.text="Hello"
    commandbuttonw1.caption ="Hello"
    5- The problem happens
    6 - Uncomment the code , The problem now disappears .
    7 - Put the following code in the same event
    Code:
    Dim s as string
    s= "Hello , I prove that not all code causes the problem , It is only for the code that draws an item in the user control"
    8 - With this previous case , the problem does not happen .

    More details and tests are found in the video for tests on the ComCtlsDemo project

    Thanks everybody for your help and sorry for bad English .
    It's a very bad idea to make some code involving the child usercontrol in the host usercontrol inside the UserControl_Initialize() event. The UC Ambient.UserMode property is not meaningful at that place. Please set your code that involves the child usercontrols in the UserControl_ReadProperties()/UserControl_InitProperties().

  8. #2248
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    429

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    It's a very bad idea to make some code involving the child usercontrol in the host usercontrol inside the UserControl_Initialize() event. The UC Ambient.UserMode property is not meaningful at that place. Please set your code that involves the child usercontrols in the UserControl_ReadProperties()/UserControl_InitProperties().
    Aha.
    Now I know why did it right in my apps.
    Not because of knowledge, I just don't use UserControl_Initialize anywhere in my UCs.
    Except in one of them, and I will correct that immediately.

  9. #2249
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    650

    Re: CommonControls (Replacement of the MS common controls)

    Krool, thank you for these superb usercontrols. In terms of DTPicker there is AllowUserInput, but this property does not 'lock' control fex. like in vb intrinsic combobox locked property does - maintaining control look like 'enabled'. Hence asking is your DTPicker control possible to set 'locked' state, without disabling it? If not, then could you consider adding locked property?

  10. #2250
    Addicted Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    248

    Re: CommonControls (Replacement of the MS common controls)

    I need to change the BackColor of a tab control but it has no BackColor property. Is this an accidental omission or is there a technical reason for this?

  11. #2251
    Addicted Member
    Join Date
    Jul 2017
    Posts
    179

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    It's a very bad idea to make some code involving the child usercontrol in the host usercontrol inside the UserControl_Initialize() event. The UC Ambient.UserMode property is not meaningful at that place. Please set your code that involves the child usercontrols in the UserControl_ReadProperties()/UserControl_InitProperties().
    Thanks for your reply krool ,
    This is the first time to know that . I will go on your advice to avoid this issue .

  12. #2252

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,222

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Minor bugfix in each WM_MOUSEACTIVATE handler.

    This is a very tiny behavior "bug" which I didn't notice and obviously nobody else.
    The standard handler of WM_MOUSEACTIVATE looked like below (taken from TextBoxW)
    and used MA_NOACTIVATEANDEAT when hittest the border or the Validate event doesn't allow to.
    However, it is more correct to use MA_ACTIVATEANDEAT.
    Code:
    Case WM_MOUSEACTIVATE
        Static InProc As Boolean
        If TextBoxTopDesignMode = False And GetFocus() <> TextBoxHandle Then
            If InProc = True Or LoWord(lParam) = HTBORDER Then WindowProcControl = MA_NOACTIVATEANDEAT: Exit Function
            Select Case HiWord(lParam)
                Case WM_LBUTTONDOWN
                    On Error Resume Next
                    With UserControl
                    If .Extender.CausesValidation = True Then
                        InProc = True
                        Call ComCtlsTopParentValidateControls(Me)
                        InProc = False
                        If Err.Number = 380 Then
                            WindowProcControl = MA_NOACTIVATEANDEAT
                        Else
                            SetFocusAPI .hWnd
                            WindowProcControl = MA_NOACTIVATE
                        End If
                    Else
                        SetFocusAPI .hWnd
                        WindowProcControl = MA_NOACTIVATE
                    End If
                    End With
                    On Error GoTo 0
                    Exit Function
            End Select
        End If
    Because let's assume you have a TextBoxW which can't get focus because the currently focused control doesn't allow. (Validate Cancel = True)
    Then assume the form get's inactive (for instance when clicking on desktop) then now when you click on the TextBoxW which is not allowed to get focus you will see that the Form will not get active. But in VB.TextBox the form will get active where the focus is still on the upper TextBox which have Validate Cancel = True.
    Name:  MA_ACTIVATEANDEAT.png
Views: 379
Size:  12.6 KB

    So this update brings the behavior to same. I know it's a very tiny detail.

    as Info: the MA_NOACTIVATE in above WM_MOUSEACTIVATE handler is still correct as SetFocusAPI implies activation of the top-level form. (SetFocusAPI internally also activates the form)

  13. #2253
    Junior Member
    Join Date
    Aug 2016
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    Hello Krool,
    I found a bug.
    I have a form with 200 texbox from vb6.
    When i convert my project from VBCCR6 to Source code CommonControls, in the moment when I compiling the project I obtein a error , runtime '0' , the haven't a licence from your control.

  14. #2254
    Junior Member
    Join Date
    Aug 2016
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    Hello Krool,
    I use MzTools 3.0 ( https://programacion.net/noticia/mzt...ual_basic_1751 ) and the properties "Fontname" in TextboxW is missing.
    The TexBox default have a properties "FontName".

    Could you fix this?

    Name:  mztools_1.jpg
Views: 274
Size:  51.7 KB

    Name:  mztools_2.jpg
Views: 270
Size:  50.0 KB

  15. #2255

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,222

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by pepegriyo2016 View Post
    Hello Krool,
    I found a bug.
    I have a form with 200 texbox from vb6.
    When i convert my project from VBCCR6 to Source code CommonControls, in the moment when I compiling the project I obtein a error , runtime '0' , the haven't a licence from your control.
    You need to convert from VBCCR16.TextBoxW to [your project name].TextBoxW

  16. #2256

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,222

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Bugfix in the internal ComCtlsTopParentValidateControls function.
    If a control validation takes place in an MDIForm it was functional working, but it had a strange "re-position" effect on mdi-child forms.
    Below illustration says more than words..

    Before



    After fix



    It could be fixed by just adding red marked code block:
    Code:
    Public Sub ComCtlsTopParentValidateControls(ByVal UserControl As Object)
    With GetTopUserControl(UserControl)
    If TypeOf .Parent Is VB.MDIForm Then
        Dim MDIForm As VB.MDIForm
        Set MDIForm = .Parent
        MDIForm.ValidateControls
    ElseIf TypeOf .Parent Is VB.Form Then
        Dim Form As VB.Form
        Set Form = .Parent
        Form.ValidateControls
    Else
        Const IID_IPropertyPage As String = "{B196B28D-BAB4-101A-B69C-00AA00341D07}"
        If VTableInterfaceSupported(.Parent, IID_IPropertyPage) = True Then
            Dim PropertyPage As VB.PropertyPage, TempPropertyPage As VB.PropertyPage
            CopyMemory TempPropertyPage, ObjPtr(.Parent), 4
            Set PropertyPage = TempPropertyPage
            CopyMemory TempPropertyPage, 0&, 4
            PropertyPage.ValidateControls
        End If
    End If
    End With
    End Sub
    VB.Form is inherited in each VB.MDIForm. However, it seems to work "better" if .ValidateControls is called on the VB.MDIForm directly.
    So it's not a real functional bugfix but rather a cosmetic fix.

    VBFlexGrid is likewise updated.

  17. #2257
    Junior Member
    Join Date
    Aug 2016
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    Hello Krool,
    I have an error in TextBoxW
    Name:  textobox_error.jpg
Views: 169
Size:  23.2 KB

    In line Of TextBoxW:
    Code:
    Public Property Set Container(ByVal Value As Object)
    Set Extender.Container = Value
    End Property

    My code is:

    Code:
    Private Sub ZoomControls(miTxt As TextBoxW, miLb As LabelW, miFrame_1 As FrameW)
    
    Set miTxt.Container = miFrame_1
    
    End Sub

    With the OCX Controls, i haven't the error.

  18. #2258
    Junior Member
    Join Date
    Aug 2016
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    Krool,
    This is the example the error.

    Add This form to ComCtlsDemo Project

    ComCtlsDemo.zip

  19. #2259

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,222

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by pepegriyo2016 View Post
    Hello Krool,
    I have an error in TextBoxW
    Name:  textobox_error.jpg
Views: 169
Size:  23.2 KB

    In line Of TextBoxW:
    Code:
    Public Property Set Container(ByVal Value As Object)
    Set Extender.Container = Value
    End Property

    My code is:

    Code:
    Private Sub ZoomControls(miTxt As TextBoxW, miLb As LabelW, miFrame_1 As FrameW)
    
    Set miTxt.Container = miFrame_1
    
    End Sub

    With the OCX Controls, i haven't the error.
    In the OCX the FrameW interface is an amalgamation of VBControlExtender and the real FrameW interface.

    Whereas in the Std-EXE version the FrameW interface is encapsulated. However, when using FrameW1 on the control itself it contains VBControlExtender, but not when passed to a sub with As FrameW.


    Solution could be to not pass FrameW into the sub but VBControlExtender.
    Changed:
    Code:
    Private Sub ZoomControls(miTxt As TextBoxW, _
                             miLb As LabelW, _
                             miFrame_1 As VB.VBControlExtender)
    Unchanged:
    Code:
    Private Sub cmdZoomURL_Click()
    Call ZoomControls(txtUrl, lbURL, Frame(1))
    End Sub

  20. #2260
    Junior Member
    Join Date
    Aug 2016
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    Thank you very much!!
    It's working

  21. #2261
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    315

    Re: CommonControls (Replacement of the MS common controls)

    Problem:

    1) Download Demo from first post in this thread
    2) Copy contents of OLEGuids to Windows\System32
    3) Open VB6
    4) Open ComCtlsDemo.vbp (loads without issue)
    5) Run

    VB6 closes

    Same thing happens when I try and open MainForm.frm in the IDE

    Any ideas?

  22. #2262

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,222

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Darkbob View Post
    Problem:

    1) Download Demo from first post in this thread
    2) Copy contents of OLEGuids to Windows\System32
    3) Open VB6
    4) Open ComCtlsDemo.vbp (loads without issue)
    5) Run

    VB6 closes

    Same thing happens when I try and open MainForm.frm in the IDE

    Any ideas?
    No idea.

  23. #2263
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,266

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Darkbob View Post
    Problem:
    2) Copy contents of OLEGuids to Windows\System32
    Did you register the TLB?

  24. #2264
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    315

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by jpbro View Post
    Did you register the TLB?
    I had to google registering a TLB... never heard of TLB's and I have no clue on how to register them. I can't see it mentioned anywhere in the readme. But I googled, found out how to register a TLB and got it registered.

    Unfortunately now the project won't run.

    Really a shame that the demo for this project won't run and there's really no mention of at least two critical steps to get the demo running. It must turn a lot of people off using it. But I'm determined to stick with it for a bit longer before I give up.

    When I try and run the project I see this:

    Name:  reg.jpg
Views: 91
Size:  20.4 KB

    In Debug I see this line highlighted:

    Name:  error.jpg
Views: 90
Size:  26.1 KB

    If the demo needs a manifest, shouldn't it be included? Where can I get one and/or make one for this project?
    Last edited by Darkbob; May 12th, 2019 at 02:53 PM.

  25. #2265
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,266

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Darkbob View Post
    I can't see it mentioned anywhere in the readme. But I googled, found out how to register a TLB and got it registered.
    It is mentioned in the GitHUb readme: "In order to use that type library, it is necessary to load the OLEGuids.tlb in the IDE. (Project -> References... -> Browse -> select file OLEGuids.tlb -> check item "OLE Guid and interface definitions")", but Googling works too so glad you got that part figured out and working.

    Quote Originally Posted by Darkbob View Post
    If the demo needs a manifest, shouldn't it be included? Where can I get one and/or make one for this project?
    I suspect it doesn't include the manifest because it is actually outside the scope of the project, and is something most devs have done as a matter of course years ago. The VB6 IDE needs to be manifested to use the newer V6 common controls. Search for "manifest vb6 ide" for a bunch of results on how to do this. Here are a few articles I found with those search terms that might be helpful:

    http://vbnet.mvps.org/code/forms/vbidevista.htm
    http://www.vbaccelerator.com/home/VB...VB/article.asp

  26. #2266
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    315

    Re: CommonControls (Replacement of the MS common controls)

    Well if the purpose of a demo is to show you how easy it will be to use... mission accomplished. The instructions are hidden on GitHub? You have to Google menifest creation in order to try out the demo?

    Somebody put a ton of work into this. Much better than many commercial products and very necessary with Microsoft constantly playing games. Really a shame the demo is so poor that it won't run out of the box. Especially since all you would need to do is edit the readme and give people a hint on how to run it.
    Last edited by Darkbob; May 12th, 2019 at 04:43 PM.

  27. #2267
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,266

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Darkbob View Post
    Well if the purpose of a demo is to show you how easy it will be to use...
    I didn't see that purpose stated the documentation

    I think the purpose of the demo was to showcase the available controls, and the purpose of the project in general is to provide Unicode replacements for the ANSI common controls used by default by VB6. Nobody said that would be easy! You need to weigh your need for Unicode controls vs. the work required to get them up and running in your environment. I assure you that Krool has done the vast majority of the really hard work compared to writing your own Unicode control replacement library. Registering a TLB and adding a manifest to your VB6 IDE is a small step above the absolute minimum that can be expected from a developer to get an OCX working from source.

  28. #2268
    Lively Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    101

    Re: CommonControls (Replacement of the MS common controls)

    darkbob,

    You do not need a manifest in order to run the demo. The only thing you need is to reference the OLEGuids.tlb file in your project. BTW, the .tlb means it is a type library. It enables VB6 to be able to specify data types, call stack order etc. differently than what is built-in to VB6. It is a powerful feature that is used all the time in VB6; normally it is behind the scenes.

    Krool included the latest OLDGuids.tlb in the OLEGuids folder of the package yo downloaded. You can reference it there. Alternatively, I keep the ltest version in C:\Windows\SysWow64 (C:\Windows\System32if you are running 32-bit Windows). It hasn't changed in 2 years so it isn't much of a hassle to put it in the common folder.

    You don't need to register it. Let's say you copied it to C:\Windows\SysWow64. In a blank VB6 project go to Project | References then click on Browse. Go find it and include it in your project. Now it will be available for all future projects you do. Just do Project | References and look for "OLE Guid and interface definitions" and check the choice.

    Know also that the type library is only used when you are in the IDE &/or compiling. It is not required to be included with the final distribution program. So it is just a file you will want to keep n your development machine. It allows you to do a lot of interesting things as Krool's demo will show you.

    That's all you need to run his demo or to use his controls.

    You will probably notice that all of his controls are included in the demo are source files. Typically controls are distributed pre-compiled in a .OCX file and you never see the source files. The advantages of what Krool has done here is that once you get it compiled you no longer need the control files; they're compiled into your code.

    There is another version of his controls where he has pre-compiled everything into one large .OCX file (read the first post of his to find the link to the thread containing that OCX file). If you go this route your compiles are faster because you dn't have to compile the source code for the controls each time but when you have your final EXE file you have to distribute that OCX with it. [That's where the side-by-side stuff can start coming into play but that's a topic for another day.]

    Let us know how all of this works for you. Krool has put in some incredible work here and I hope you can benefit from it as we have.

  29. #2269

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,222

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Darkbob View Post
    I had to google registering a TLB... never heard of TLB's and I have no clue on how to register them. I can't see it mentioned anywhere in the readme. But I googled, found out how to register a TLB and got it registered.

    Unfortunately now the project won't run.

    Really a shame that the demo for this project won't run and there's really no mention of at least two critical steps to get the demo running. It must turn a lot of people off using it. But I'm determined to stick with it for a bit longer before I give up.

    When I try and run the project I see this:

    Name:  reg.jpg
Views: 91
Size:  20.4 KB

    In Debug I see this line highlighted:

    Name:  error.jpg
Views: 90
Size:  26.1 KB

    If the demo needs a manifest, shouldn't it be included? Where can I get one and/or make one for this project?
    Please make the following setting in your VB6 IDE to not crash the IDE when it is not manifested.

    In order to trap error raises via "On Error Goto ..." or "On Error Resume Next" it is necessary to have "Break on Unhandled Errors" selected instead of "Break in Class Module" on Tools -> Options... -> General -> Error Trapping.

Page 57 of 57 FirstFirst ... 74754555657

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