Page 47 of 94 FirstFirst ... 374445464748495057 ... LastLast
Results 1,841 to 1,880 of 3726

Thread: CommonControls (Replacement of the MS common controls)

  1. #1841

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    6- Set all class modules instances to GlobalMultiuse.
    Wrong. Put all classes to "PublicNotCreatable".
    Except CommonDialog.cls. This shall be "MultiUse". (Not "GlobalMultiUse")
    Also some classes should kept "Private" such as Enumeration.cls, VTableSubclass.cls etc.
    So an advise to put everything on GlobalMultiUse is not so good.

    For the other stuff in WindowProcUserControlDesignMode it is a safety to remove subclassing in IDE at DesignTime. In the OCX this is not needed. If it keeps there it can even produce glitches. You had once an issue with the CommandButtonW that it went blank on certain steps. This was one case of that.

    Anyhow, you can proceed how you want..
    Last edited by Krool; Nov 7th, 2017 at 12:45 PM.

  2. #1842
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Wrong. Put all classes to "PublicNotCreatable".
    Except CommonDialog.cls. This shall be "MultiUse". (Not "GlobalMultiUse")
    Also some classes should kept "Private" such as Enumeration.cls, VTableSubclass.cls etc.
    So an advise to put everything on GlobalMultiUse is not so good.

    For the other stuff in WindowProcUserControlDesignMode it is a safety to remove subclassing in IDE at DesignTime. In the OCX this is not needed. If it keeps there it can even produce glitches. You had once an issue with the CommandButtonW that it went blank on certain steps. This was one case of that.

    Anyhow, you can proceed how you want..
    thanks a lot krool for correction . Of course I will proceed in the way you provided . I will re-write these steps again until we come to the ideal way

  3. #1843

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    OCX Version 1.5 now released.

  4. #1844
    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
    OCX Version 1.5 now released.
    Thanks for the new release. Im using these controls in a new project. really appreciate your time and effort in these controls!
    Was wondering if there would be any chance of being able to add a color option for tool bar button caption text.
    thanks again.

  5. #1845

    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
    Thanks for the new release. Im using these controls in a new project. really appreciate your time and effort in these controls!
    Was wondering if there would be any chance of being able to add a color option for tool bar button caption text.
    thanks again.
    You must have overlooked it. There is a ForeColor property available.
    Code:
    ToolBar1.Buttons(1).ForeColor
    This can also be defined at design-time trough the property page.

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

    Re: CommonControls (Replacement of the MS common controls)

    ahh ok. yes i missed it, i was looking under the color tab and in the main toolbar properties. The fact that it is per button makes it even cooler! Thankyou!

    Edit: I couldnt get any of the custom foreground colors to 'stick' from the property pages, only set from code, so far for toolbar button and status bar panels. is this by design?
    Last edited by vbLewis; Nov 14th, 2017 at 06:11 PM.

  7. #1847

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Source code for both Std-EXE and ActiveX version has been put on GitHub. Link can be found on initial post.

    Quote Originally Posted by vbLewis View Post
    I couldnt get any of the custom foreground colors to 'stick' from the property pages, only set from code, so far for toolbar button and status bar panels. is this by design?
    For me it works, so I cannot replicate your problem. What do you mean exactly? Please describe step-by-step.
    Last edited by Krool; Nov 18th, 2017 at 02:28 PM.

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

    Re: CommonControls (Replacement of the MS common controls)

    Add toolbar control to form -> click on 'custom' to open custom property page dialog -> add toolbar button -> click on colored command button to change button foreground color -> select new color for button caption -> click OK -> color dialog closes and color on command button in property sheet stays the same as it was. same for font, cannot change size.

    are you calling 'propertychanged()' when property is changed in in property sheet? it may be a storage bag permission problem on my end too.

    when i use the normal toolbar properties tab in the IDE to change font, font size is changed and works ok. but of course it doesnt edit colors for a single button, only the entire toolbar. I can set color for individual buttons from code and works good that way.

  9. #1849

    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
    Add toolbar control to form -> click on 'custom' to open custom property page dialog -> add toolbar button -> click on colored command button to change button foreground color -> select new color for button caption -> click OK -> color dialog closes and color on command button in property sheet stays the same as it was. same for font, cannot change size.

    are you calling 'propertychanged()' when property is changed in in property sheet? it may be a storage bag permission problem on my end too.

    when i use the normal toolbar properties tab in the IDE to change font, font size is changed and works ok. but of course it doesnt edit colors for a single button, only the entire toolbar. I can set color for individual buttons from code and works good that way.
    Update released. Please test again. Thanks

  10. #1850
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    New Pager Problem

    Try with the attached.
    Pager3.zip

    The problem is, when I modify a Pager's buddy, then the buddy gets clipped.
    It is not with a PictureBox (discussed before), but with a standard UC.

    EDIT:
    A PictureBox as the buddy works ok with the workaround described in #1820.
    Now I use this approach instead of using a UC as the buddy.
    Last edited by Karl77; Nov 23rd, 2017 at 08:06 AM.

  11. #1851
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    261

    Re: CommonControls (Replacement of the MS common controls)

    Krool,

    I was just working with you VBFlexGrid Demo system and now that you have an OCX version I thought I would make the same sample program using the OCX file. I decided to make the two forms with your VBCCRxx OCX files and I just noticed that you didn't include a PictureBox in your VBCCRxx controls. Was that intentional and if so, why? I assume I can use the ImageList control to achieve the same results and I am guessing that's why you didn't do one for VBCCRxx but I thought I would ask.

  12. #1852

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    MountainMan,
    PictureBox replacement is not needed and there are also better alternatives, e.g. AlphaImageControl.
    ImageList was necessary to work together with the controls.

  13. #1853
    Registered User
    Join Date
    Jan 2015
    Posts
    1

    Re: CommonControls (Replacement of the MS common controls)

    Want to report a problem
    RichTextBox can't do anything to clear up, if SelProtected is being used or the document is already contain SelProtected Text
    BTW, thank you for this wonderful control!

  14. #1854
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    TABSTRIP QUESTION

    The TabClick events is fired immediately when the mouse button is down on the tab.
    In other controls, like CommandButtonW, the click events is not fired until the mouse button is released over the control.

    Any chance to improve this behavior for the TabStrip?

    Karl

  15. #1855
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    SUBCLASSING QUESTION (again)

    In post #1814 Dex told me how to use the subclassing provided by VBCCR.
    This works quite well.

    But when we use the OCX and not the EXE version, this can't be done.
    ComCtlsSetSubclass/ComCtlsRemoveSubclass is not avaiable.

    Krool, is it possible to use your subclassing along with the OCX version?
    And if, how?

  16. #1856

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    The IDE (does not effect compiled exe) will not crash anymore when using VBCCRxx.OCX and VBFLXGRDxx.OCX in paralell. (Std-EXE version not concerned)

  17. #1857
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    here is a video demonstration of my problem

    part1
    https://www.youtube.com/watch?v=yGxSBtCk7co

    part2
    https://www.youtube.com/watch?v=1IZPDRRCAsI

    and sorry for awful accent

  18. #1858
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Hosam, do you use the most recent version or the former version?
    If you use the most recent version, can you try the same with yesterday`s version?
    Or the other way around?

    Do you get the same result when you use the OCX?
    Last edited by Karl77; Dec 10th, 2017 at 01:54 PM.

  19. #1859
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    thanks karl , here is the test for the ocx
    https://youtu.be/sPcpaampZa4

  20. #1860
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    here is a test with the most recent ocx and it is the same result
    https://youtu.be/uooZxHBKV24

  21. #1861
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Hosam
    I think it will be good if you upload the projects in question here.
    So that we and especially Krool can retrace the error.
    Videos are not so very helpful in this case.

  22. #1862
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    I think it is not a problem of code karl . As in the videos , the same code runs successfully in a time and causes vb to crash in another time . Also , the STDexe project never run successfully with me . Once I open it , or just try to view the FrmMain , Vb crashes . This of course is not the case for any of the members here as almost no one reported this problem . So , I think it is not a matter of code . It might be something related to registry entries or binary conflict or something in VB6 IDE itself . This was the reason I uploaded these videos : to see what is wrong in my case . But I will upload the project also . It might be something common . Thanks karl .

    Edit 1 :
    the project source code . Just put the database in the D:\ partition and add a reference to ado 2.5 library and of course VBCCR 1.5 OCX

    test.zip.docx
    Last edited by Hosam AL Dein; Dec 11th, 2017 at 03:07 AM. Reason: add an attachment

  23. #1863
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Hosam

    Do you run the VB6 IDE with admin rights?
    From the videos, I don't see the UAC dialog coming up.

    I tried to test here with VBCCR15, but it seems I don't have the correct database tools installed.
    Unfortunately, I can't run the project using the data connection.

    When I comment out all the database related stuff, then the project runs well in the IDE.
    And does never crash.

    A remark:
    It is good to use Option Explicit in your code, it can help a lot.
    Last edited by Karl77; Dec 11th, 2017 at 06:16 AM.

  24. #1864
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    yes karl vb6 runs with admin rights .

    Name:  dddddddddw.jpg
Views: 1078
Size:  52.8 KB

    and I used option explicit and same results came up

    For the database , I use MS access 2010 . It is necessary to setup it and run the database code to exactly simulate the case I have

  25. #1865
    New Member
    Join Date
    Dec 2017
    Location
    London, England
    Posts
    4

    Re: CommonControls (Replacement of the MS common controls)

    Hi, would this work for 64-bit Word / Excel?
    Do you have anything to replace OWC11, again for 64-bit Word?
    Thanks

  26. #1866
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by MMcC View Post
    Hi, would this work for 64-bit Word / Excel?
    Do you have anything to replace OWC11, again for 64-bit Word?
    Thanks

    I believe it would not. Office x64 is not compatible with 32bit COM
    beside for your information, Microsoft does recommand to NOT install x64 version of Office UNLESS:

    "you are opening image or database of more then 2gb"
    ref.:
    https://support.office.com/en-us/art...e-6c6f49b8d261

    People tend to think x64 version are better and faster. This is absolutely not true with the exception of file OVER 2gb
    wich very FEW people in the whole world use (news editors is a good example of such users)

    I have a very large Database in access with history of more then 100 000 records and the database has a file of 3mb
    The biggest I ever saw in Office was a 240mb file from a powerpoint for the end of school (prom) newspaper. there were over
    thousand images in it. we're far from the 2gb limit

  27. #1867

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VbNetMatrix View Post
    I believe it would not. Office x64 is not compatible with 32bit COM
    beside for your information, Microsoft does recommand to NOT install x64 version of Office UNLESS:

    "you are opening image or database of more then 2gb"
    ref.:
    https://support.office.com/en-us/art...e-6c6f49b8d261
    The project is limited to 32 bit.

    Even in Access 2013 format x64 the database limit is 2GB. So even no advantage on that..

    And the 4GB memory limitation for 32 bit is not an argument. Every 32 bit process can have 4gb allocation. (Not in total allocation; per process allocation)
    So who want to use more than 4gb of ram in an office instance?

    My advise: go back to 32 bit office.

  28. #1868
    New Member
    Join Date
    Dec 2017
    Location
    London, England
    Posts
    4

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The project is limited to 32 bit.

    Even in Access 2013 format x64 the database limit is 2GB. So even no advantage on that..

    And the 4GB memory limitation for 32 bit is not an argument. Every 32 bit process can have 4gb allocation. (Not in total allocation; per process allocation)
    So who want to use more than 4gb of ram in an office instance?

    My advise: go back to 32 bit office.
    The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors. It's a very complex planning application with a big updateable data cube being presented in an embedded worksheet in Word. We've slimmed it down as much as we can but it's right up against the limit. Hence we are looking at the possibility of 64-bit which doesn't have the 4Gb memory limitation.

    Is there any way we can get multiple processes running from within the one VBA app?

  29. #1869

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by MMcC View Post
    The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors. It's a very complex planning application with a big updateable data cube being presented in an embedded worksheet in Word. We've slimmed it down as much as we can but it's right up against the limit. Hence we are looking at the possibility of 64-bit which doesn't have the 4Gb memory limitation.

    Is there any way we can get multiple processes running from within the one VBA app?
    I have made the experience that x64 office also do raise "out of memory". Reason could be some virtual memore pages and not related to physical memory at all.

  30. #1870
    New Member
    Join Date
    Dec 2017
    Location
    London, England
    Posts
    4

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    I have made the experience that x64 office also do raise "out of memory". Reason could be some virtual memore pages and not related to physical memory at all.
    So what approach would you recommend to avoid / reduce / manage the out of memory errors?

  31. #1871
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    261

    Re: CommonControls (Replacement of the MS common controls)

    MMcC, it is fairly easy to get multiple apps running from one VBA application. VBA is inherently single-threaded but using shell you can start as many new process as you have memory for. In addition, you can communicate between the separate processes. For example, I have a file manager program that is written in Excel that has the option of doing the specified file operation(s) such as copy, move, rename or delete files and/or folders within the currently running instance of Excel or it can spawn a new instance of Excel and do them separate from the current instance. In fact, you can spawn as many of these as you want. I have also seen this technique used to do many web searches at one time. Yes there is some overhead by starting new instances of Excel, Access, Word, etc. but it is really not that much (maybe 20mb) in today's multiple gigabyte systems. It is a handy way of effectively multi-tasking from within VBA (same code works in VB6 too). I could upload some code to show you how to do this if you are interested.

  32. #1872
    Hyperactive Member
    Join Date
    Aug 2017
    Posts
    380

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by MMcC View Post
    The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors.
    “Out Of Memory” Does Not Refer to Physical Memory might offer some insight on why you're getting that error.

  33. #1873
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by MMcC View Post
    The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors. It's a very complex planning application with a big updateable data cube being presented in an embedded worksheet in Word. We've slimmed it down as much as we can but it's right up against the limit. Hence we are looking at the possibility of 64-bit which doesn't have the 4Gb memory limitation.

    Is there any way we can get multiple processes running from within the one VBA app?

    if your program is using more then 4gb ram memory (in ANY scenario), it is most likely a memory leak issue.
    in c# for example, lot of people are using COM component without using the garbage collector wich is MANDATORY when using COM component in Managed code. More to that, while using COM, the simple rule that apply is "never use 2 dot" (meaning don't use this.property.property) because it will cause a memory leak while the .NET do this in memory:
    TempObject= this.property
    userobject = TempObject.property (equivalent to this.property.property )

    the TempObject will reside in memory even if you use the GC collector and then you got memory leak.

    you're talking about using worksheet in Word, (this is using COM component) plz check your code for double dot and GC collector properly used.

    Krool: didn'T intended to hijack your thread with this answer, if you think it was innapropriate, just tell me I'll refrain myself in the futur.
    Last edited by VbNetMatrix; Dec 15th, 2017 at 03:49 PM. Reason: misspelled user name

  34. #1874
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Any suggestions for my question guys ?

  35. #1875
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    679

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    Any suggestions for my question guys ?
    Briefly watched your video. I think that it is not the grid component, but the ADO which causes the IDE crash. Solution is to properly close ADO connection and set the ADO object to nothing (by VB code) before closing application.

    fex...
    Code:
    'in form QueryUnload routine
        DB.Close 'close db connection
        Set DB = Nothing
    'or 
    Set rs = Nothing
    Set cmd.ActiveConnection = Nothing
    Set cmd = Nothing
    More information
    https://docs.microsoft.com/en-us/sql...ose-method-ado
    https://docs.microsoft.com/en-us/sql...ods-example-vb
    http://www.vbforums.com/showthread.p...ado-connection

  36. #1876
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    double post for some server reason...
    Last edited by VbNetMatrix; Dec 19th, 2017 at 05:31 PM.

  37. #1877
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    here is a video demonstration of my problem

    part1
    https://www.youtube.com/watch?v=yGxSBtCk7co

    part2
    https://www.youtube.com/watch?v=1IZPDRRCAsI

    and sorry for awful accent
    There is a few thing I have noticed but it is really simple Vb6 programming rules that are not applied.

    one of the is your declaration with the NEW keyword.

    in Vb6 you must NEVER declare a variable with a NEW keyword, this has been documentated at least a hundred time
    it mess up the memory in many ways.

    always prefers the method:

    Dim YourObject as ...

    Set YourObject = new ...

    then, never forget to DESTROY the object when you are done with it.

    Set YourObject = Nothing
    (you're not doing it so you got a memory leak there that in time will crash the IDE while debugging)

    same thing with the WITH keyword, it's better to avoid it when not necessary, I missed why you really need the first WITH.

    aside from that, you didn't showed what reference object you are using for the RecordSet, there is many version of the MDAC and only the 2.8 and 6.1 (6.0) are stable for Win7+ if you're using anything different, it might as well be your problem
    Microsoft recommend to use only the 6.0 for Win7+

    if you could post a non working project, it would be easier for diagnose. as for me, I didn't use that component for year because I created my own component based on 6.0

    I doubt it has anything to do with Krool control. did you tested your code with regular control ?

    I also noticed the bug you got when you open Vb6, the only time I saw this bug was with a Custom made USB portable version for Vb6 and it contain a Trojan (virus)
    I would fix your installation before attempting to search for gremlins.

  38. #1878

    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
    TABSTRIP QUESTION

    The TabClick events is fired immediately when the mouse button is down on the tab.
    In other controls, like CommandButtonW, the click events is not fired until the mouse button is released over the control.

    Any chance to improve this behavior for the TabStrip?
    It seems that behavior is wanted by the TabStrip control. It's done by comctl32.dll. (TCN_SELCHANGE)
    The only workaround would be to handle MouseUp event and perform a HitTest.

    Edit: you certainly also need to handle TabBeforeClick and pass True to the 'Cancel' parameter. Thus it will not change selection prior your MouseUp workaround.
    Last edited by Krool; Jan 3rd, 2018 at 01:51 PM.

  39. #1879
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Thanks for precious information VBnetmatrix . I will give these points a try and post my the result here

  40. #1880
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    It seems that behavior is wanted by the TabStrip control. It's done by comctl32.dll. (TCN_SELCHANGE)
    Aha, I thought it was not intended.

    The only workaround would be to handle MouseUp event and perform a HitTest.
    Ok, that's not much effort.

    Edit: you certainly also need to handle TabBeforeClick and pass True to the 'Cancel' parameter. Thus it will not change selection prior your MouseUp workaround.
    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.

    See attached example.Tbs.zip

Page 47 of 94 FirstFirst ... 374445464748495057 ... 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