Page 75 of 77 FirstFirst ... 2565727374757677 LastLast
Results 2,961 to 3,000 of 3042

Thread: CommonControls (Replacement of the MS common controls)

  1. #2961
    Fanatic Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,013

    Re: CommonControls (Replacement of the MS common controls)

    I start using Crool's controls, and I found some not just as I expect. Tooltips are not unicode.

    In my form I use Greek letters. My VB6 IDE is in a Windows 64, Greek is primary language. Also the selectet language for VB6 IDE is Greek
    So in my machine work nice, and I get greek letters for captions and tooltip. But in another machine, which have English as primary language, tooltips are saved as ANSI, and for this reason I didn't get ? characters (code 63), but the ansi numbers (from codepage for Greek letters) as in Western Europian codepage.
    Attached Images Attached Images  

  2. #2962

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

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by georgekar View Post
    I start using Crool's controls, and I found some not just as I expect. Tooltips are not unicode.

    In my form I use Greek letters. My VB6 IDE is in a Windows 64, Greek is primary language. Also the selectet language for VB6 IDE is Greek
    So in my machine work nice, and I get greek letters for captions and tooltip. But in another machine, which have English as primary language, tooltips are saved as ANSI, and for this reason I didn't get ? characters (code 63), but the ansi numbers (from codepage for Greek letters) as in Western Europian codepage.
    The ToolTipText property of the main object itself (VBControlExtender, e.g. CommandButtonW1.ToolTipText etc.) are the intrinsic properties by VB6 and thus ANSI.

    Only ToolTipText properties in class objects (e.g. TabStrip1.Tabs(1).ToolTipText etc.) are enhanced for Unicode and also support multi-line.

  3. #2963
    Lively Member
    Join Date
    Jul 2017
    Posts
    114

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The ToolTipText property of the main object itself (VBControlExtender, e.g. CommandButtonW1.ToolTipText etc.) are the intrinsic properties by VB6 and thus ANSI.
    Why dont we extend the project and add a unicode tooltiptext class and add the property ToolTipTextW to all controls?

  4. #2964
    PowerPoster
    Join Date
    Jun 2013
    Posts
    5,254

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    Why dont we extend the project and add a unicode tooltiptext class and add the property ToolTipTextW to all controls?
    IMO there's no need for it.

    Krool could simply implement a central Window-Creation-Hook, which reacts to the old "VB6-ToolTip-ClassName",
    which then activates (fires), when the VB6-runtime fires-up its own, ANSI-ToolTip-Window
    (then overwriting the area of that Window with the original, but now Unicode-rendered Tooltip-Strings).

    Even MultiLine-Tooltips are possible this way, when one declares a certain Char as the LineBreak-char
    (in our larger VB6-App we've used the PipeChar ("|") for that, IIRC).

    Olaf

  5. #2965

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

    Re: CommonControls (Replacement of the MS common controls)

    IMO any hooks should reside in an App and not in this package.

    So you can use the CommandButtonW.ToolTipText property and use this Code to enable Unicode and multi-line. (See bottom post by MountainMan)

  6. #2966
    Lively Member
    Join Date
    Jul 2017
    Posts
    114

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    IMO any hooks should reside in an App and not in this package.
    You dont need any hooks when using a new tooltiptext property!

    For the basics just add a new public property called "ToolTextTipW" or "ToolTextTipWide" to all controls to store the unicode text displayed by the tooltiptext and use the api CreateWindowExW to create the tooltiptext. no need for any hooks. i can send you my tooltiptext class if you need the source code to do this.

    This change would make the VBCCR project more complete. no more need for external classes and tooltip source code cluttered everywhere in the forms/modules.

    We also can add additional tooltip properties like icon, title, multiline, forecolor, backcolor, delay time, display time...

  7. #2967
    Fanatic Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,013

    Re: CommonControls (Replacement of the MS common controls)

    I am waiting for the new version with ToolTextTipW

  8. #2968
    Lively Member
    Join Date
    Jul 2017
    Posts
    114

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by georgekar View Post
    I am waiting for the new version with ToolTextTipW
    It's quite easy to add a new basic unicode tooltiptext but it depends on krool to do this.

    I could do this myself but i dont want to start a new fork of the VBCCR project...

  9. #2969

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

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    It's quite easy to add a new basic unicode tooltiptext but it depends on krool to do this.

    I could do this myself but i dont want to start a new fork of the VBCCR project...
    VBCCR17 is planned to be last major release. People also have a desire for a constant stable release.
    If any bugs appear they will be of course fixed.

    So feel free to make another fork..

  10. #2970
    Fanatic Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,013

    Re: CommonControls (Replacement of the MS common controls)

    @Mith,
    Expose your idea, for someone like me to include it in an embedded fashion use of Krools controls. So then I can place the code to any control I wish to include a Unicode tooltip.

  11. #2971
    Fanatic Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,013

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

    I have the solution for unicode tooltips. This tested for command button control.

    I use from Elroy some routines, and I found a way (using mouse tracking) to enable/disable the tooltip. Also in IDE, in running or at design we get the ordinary vb6 tooltip.
    My test program is in the zip file.
    We have two more properties:
    ToolTipTextEx
    ToolTipTextTitle

    To prove the solution I place english, greek and russian to same tooltip.
    Why I have a second ToolTipText?
    Because if we have the original one, then that has something different from the new one, and do some conversions. So we use the second one for the unicode, and that handle the first one for using it in IDE, at design and at running status.


    Code:
    Private Sub Form_Load()
    CommandButtonW1.ToolTipTextTitle = "a TITLE"
    CommandButtonW1.ToolTipTextEx = CommandButtonW1.ToolTipTextEx + ListenUnicode(32, 917, 955, 955, 951, 957, 953, 954, 940) + ", " + ListenUnicode(1076, 1086, 1073, 1088, 1086, 1077, 32, 1091, 1090, 1088, 1086)
    
    
    End Sub
    Also in the example below, I have some extra:
    1. A way to use a mutex to handle the unique execution of program
    2. IsWine is a function to find if the program run in linux through wine
    3. To place the greek and russian I use one function, listenUnicode, which get the characters by numbers. To produce these numbers, I have a module testfromclipboard, with one statement: Debug.Print SpellUnicode(GetTextData(CF_UNICODETEXT)), so we copy to clipboard text and we get the numbers in the Immediate window, to copy these as parameters in a ListenUnicode() function.


    Revision 2,
    I found a missing statement from Elroy's code:
    Code:
     SendMessage hwndTT, TTM_SETMAXTIPWIDTH, 0&, 0
    Without this we didn't get additional lines which the CreateTool introduce these on the wrapping function.
    Attached Files Attached Files
    Last edited by georgekar; Nov 18th, 2020 at 05:17 PM. Reason: New Version

  12. #2972
    Addicted Member
    Join Date
    Jul 2016
    Posts
    174

    Re: CommonControls (Replacement of the MS common controls)

    Hey, is it possible to have columns in the treeview?

    Sample image from the net attached.
    Attached Images Attached Images  

  13. #2973
    Addicted Member
    Join Date
    Jul 2016
    Posts
    174

    Re: CommonControls (Replacement of the MS common controls)

    Or something like this? Looks like a listview per row within a treeview.
    Attached Images Attached Images  

  14. #2974
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    6,026

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    Or something like this? Looks like a listview per row within a treeview.
    A little off topic but one look at this post and WPF immediately came to mind. WPF can do wild and crazy stuff like this very easily. If you're like me and prone to wanting all kinds of crazy combinations of layouts and controls for your UI, you owe it to yourself to check out WPF some time in your life. You will not be disappointed.
    Last edited by Niya; Nov 25th, 2020 at 04:40 PM.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  15. #2975
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,170

    Re: CommonControls (Replacement of the MS common controls)

    The vsFlexGrid is capable of showing a tree in a column of the grid.
    Maybe Krool will implement something like this in his vbFlexGrid control

  16. #2976
    Addicted Member
    Join Date
    Jul 2016
    Posts
    174

    Re: CommonControls (Replacement of the MS common controls)

    Thank you, but as far as I can tell, WPF is not VB6.

    Is it possible to have word-wrap/newlines in a row in a VBCCR16/17 listview?

  17. #2977

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

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    Thank you, but as far as I can tell, WPF is not VB6.

    Is it possible to have word-wrap/newlines in a row in a VBCCR16/17 listview?
    No. SysListView32 does not support it.

  18. #2978
    PowerPoster
    Join Date
    Jun 2013
    Posts
    5,254

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    No. SysListView32 does not support it.
    @OldClock

    You can accomplish your desired outputs quite easily, when you use Virtual-List-Controls.

    Here's two different ones, I've posted into the CodeBank (both without RichClient-dependencies, though still quite small CodeBases):
    https://www.vbforums.com/showthread....TreeList-Demo)
    https://www.vbforums.com/showthread....)-TileView-Ctl

    HTH

    Olaf

  19. #2979
    New Member
    Join Date
    Dec 2020
    Posts
    1

    Re: CommonControls (Replacement of the MS common controls)

    I registered the "VBCCR17.OCX" in Windows 10, and then tried to use Krool's controls in VFP 9's IDE, unfortunately, the VFP 9 crash.
    It seems that Krool's controls (OCX version) can only work with VB6, but MS common controls can support VFP, delphi or any other programming language correctly.

  20. #2980
    Lively Member
    Join Date
    Oct 2016
    Posts
    66

    Re: CommonControls (Replacement of the MS common controls)

    Hi!
    I browsed through this thread which mentions that its possible to use Transparent images with the the imagelist/toolbar.
    I assume that you would need to use PNG files.
    I would appreciate on some guidance on how to load PNG files, because the standard methods don't work

  21. #2981
    Addicted Member
    Join Date
    Mar 2009
    Posts
    206

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    Hi!
    I browsed through this thread which mentions that its possible to use Transparent images with the the imagelist/toolbar.
    I assume that you would need to use PNG files.
    I would appreciate on some guidance on how to load PNG files, because the standard methods don't work
    Isn't it just using a mask color for that, or Icon files?

  22. #2982
    Lively Member
    Join Date
    Oct 2016
    Posts
    66

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by SuperDre View Post
    Isn't it just using a mask color for that, or Icon files?
    mask colour is a nice way to improvise, and that's what i have been doing until now.
    Using PNG files is much cleaner and in my opinion a better way to work (if it is possible).

  23. #2983
    Fanatic Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    666

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    Using PNG files is much cleaner and in my opinion a better way to work (if it is possible).
    We all want VB6 to support PNGs but it is a limitation of the product.

    You can incorporate La Volpe's code and then you will be able to read and display PNGs in your VB6 image controls. You can also work with GDI+ or similar as it can handle PNGs natively and display them within your VB6 program.

    I have used both in my recent creations to handle PNGs. It is a considerable workaround but can be done.

    Just expanded VFP 9 to find it means Visual Fox Pro... that is not VB6. The BASIC advice will receive here will not help you much.
    Last edited by yereverluvinuncleber; Dec 27th, 2020 at 09:06 AM.

  24. #2984
    Addicted Member
    Join Date
    Mar 2009
    Posts
    206

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by myfav View Post
    I registered the "VBCCR17.OCX" in Windows 10, and then tried to use Krool's controls in VFP 9's IDE, unfortunately, the VFP 9 crash.
    It seems that Krool's controls (OCX version) can only work with VB6, but MS common controls can support VFP, delphi or any other programming language correctly.
    Ofcourse if the OXC crashes VFP 9's IDE there is a problem with the OCX as it should not do that. Does it crash on the usage of a specific component of the OCX or does it crash completely?

  25. #2985
    Lively Member
    Join Date
    Jul 2017
    Posts
    114

    Lightbulb textbox maximum character

    vbccr v1.7.1

    i can't enter the maximum supported character length of 32K chars using the textboxW control.

    i tried it with the following code:

    textboxW.text = String(32000, "a")
    or
    textboxW.text = String(6500, "a")

    none of them above filled the textbox!

    but String(650, "a") works!

    the maxlength property is set to 0.

    Edit:
    after some testing i found out that the limit is 4095 chars...

    Edit2:
    Problem solved:
    the property .MultiLine=True enables the support of 32K maximum characters!
    Last edited by Mith; Dec 29th, 2020 at 10:11 PM.

  26. #2986
    Lively Member
    Join Date
    Jul 2017
    Posts
    114

    Question RichTextBox cutting the text after word wrap

    vbccr v1.7.1

    i load a 6 MB text file into a RichTextBox using the command:

    Code:
    rtfLog.LoadFile sLogFile, RtfLoadSaveFormatUnicodeText
    now the size of the RichTextBox content is 3102656 bytes determined by the command:
    Code:
    Len(rtfLog.Text)
    after that i do a word wrap with the command:

    Code:
    rtfLog.ScrollBars = vbVertical
    after the word wrap the content of the RichTextBox is truncated: now the size is only 67731 bytes!

    any idea how to word wrap without cutting the content of the RichTextBox?
    or is this a bug?

    control properties:

    Name:  Screenshot - 15.01.2021 , 12_30_53.png
Views: 374
Size:  17.4 KB

  27. #2987

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

    Re: RichTextBox cutting the text after word wrap

    Quote Originally Posted by Mith View Post
    vbccr v1.7.1

    i load a 6 MB text file into a RichTextBox using the command:

    Code:
    rtfLog.LoadFile sLogFile, RtfLoadSaveFormatUnicodeText
    now the size of the RichTextBox content is 3102656 bytes determined by the command:
    Code:
    Len(rtfLog.Text)
    after that i do a word wrap with the command:

    Code:
    rtfLog.ScrollBars = vbVertical
    after the word wrap the content of the RichTextBox is truncated: now the size is only 67731 bytes!

    any idea how to word wrap without cutting the content of the RichTextBox?
    or is this a bug?

    control properties:

    Name:  Screenshot - 15.01.2021 , 12_30_53.png
Views: 374
Size:  17.4 KB
    Changing the ScrollBars to vbVertical triggers internally a re-creation of the rich text box.
    So try to put the code before you load the 6MB file for a quick fix.
    However, I would like to test whats the problem. Can you wrap up a demo project?

  28. #2988
    Lively Member
    Join Date
    Jul 2017
    Posts
    114

    Re: RichTextBox cutting the text after word wrap

    Quote Originally Posted by Krool View Post
    Changing the ScrollBars to vbVertical triggers internally a re-creation of the rich text box.
    So try to put the code before you load the 6MB file for a quick fix.
    However, I would like to test whats the problem. Can you wrap up a demo project?
    i guess the text content get truncated somewhere at the re-creation function.

    Is it really necessary to re-create the whole control when switching the scrollbars?

    Isnt there any SendMessage/SetWindowLong command to hide/show the scrollbars?

    Example:

    Style = GetWindowLong(rtbHandle, GWL_STYLE)
    Style = Style And WS_VSCROLL
    SetWindowLong (rtbHandle,GWL_STYLE,Style)

  29. #2989

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

    Re: RichTextBox cutting the text after word wrap

    Quote Originally Posted by Mith View Post
    i guess the text content get truncated somewhere at the re-creation function.

    Is it really necessary to re-create the whole control when switching the scrollbars?

    Isnt there any SendMessage/SetWindowLong command to hide/show the scrollbars?

    Example:

    Style = GetWindowLong(rtbHandle, GWL_STYLE)
    Style = Style And WS_VSCROLL
    SetWindowLong (rtbHandle,GWL_STYLE,Style)
    When you find a way of changing it without re-creation, please advise. However, I could have gone like the MS RichTextBox and throw out an error when attempting to change at runtime.

  30. #2990
    Lively Member
    Join Date
    Jul 2017
    Posts
    114

    Re: RichTextBox cutting the text after word wrap

    Quote Originally Posted by Krool View Post
    When you find a way of changing it without re-creation, please advise.
    it's not possible. i tried but after i read this at the MS doc: "After the control has been created, these styles cannot be modified, except as noted.": https://docs.microsoft.com/en-us/win...control-styles

    looks like re-creation is the only way to to this...

    btw, i found out that using TextMode=1 solves my problem:
    the text content doesnt got manipulated after switching the scrollbars!

    using TextMode=0 and switching the scrollbars to enable WordWrap truncates the text!
    Maybe you will check this out.

  31. #2991
    Addicted Member
    Join Date
    Jul 2017
    Posts
    217

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool ,
    A strange behavior in ListView .
    When opening some form modally by clicking a ListView column header , it does not have the (Focus) and seems as it is not mainly shown . When you click somewhere on the modal form and this point of click hits the behind column header , the column header click event is fired as if there is no form in front . Also , the form needs two interactions (Clicks) to respond to the mouse click .

    I tested this in both OCX and StdExe versions . Here is a Demo to explain what I mean . You need to click any listview header >> Form2 is then shown modally >> then click on the label on Form2 . (I put some positioning code to assure that the click will hit the behind column header) .

    Re-test this by opening the form with any other command (Not from Column_Click event .. Say by a command button) , the problem will not arise then .

    Wrapped Demo.zip

    Edit :
    Calling SetCapture API Function solves the issue of passing the click to the behind ListView , but the modal form still needs two clicks to respond and actually receives the focus .
    Last edited by Hosam AL Dein; Jan 22nd, 2021 at 12:56 AM.

  32. #2992

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

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    Hi Krool ,
    A strange behavior in ListView .
    When opening some form modally by clicking a ListView column header , it does not have the (Focus) and seems as it is not mainly shown . When you click somewhere on the modal form and this point of click hits the behind column header , the column header click event is fired as if there is no form in front . Also , the form needs two interactions (Clicks) to respond to the mouse click .

    I tested this in both OCX and StdExe versions . Here is a Demo to explain what I mean . You need to click any listview header >> Form2 is then shown modally >> then click on the label on Form2 . (I put some positioning code to assure that the click will hit the behind column header) .

    Re-test this by opening the form with any other command (Not from Column_Click event .. Say by a command button) , the problem will not arise then .

    Wrapped Demo.zip

    Edit :
    Calling SetCapture API Function solves the issue of passing the click to the behind ListView , but the modal form still needs two clicks to respond and actually receives the focus .
    I confirm the issue and clearing the mouse capture before raising the event fixes both issue you encountered. I am just double checking if this is the "correct" solution before I do an update release.
    see below new code added in blue
    Code:
    Case LVN_COLUMNCLICK
        CopyMemory NMLV, ByVal lParam, LenB(NMLV)
        ReleaseCapture
        RaiseEvent ColumnClick(Me.ColumnHeaders(NMLV.iSubItem + 1))
    Last edited by Krool; Jan 22nd, 2021 at 03:31 AM.

  33. #2993
    Addicted Member
    Join Date
    Jul 2017
    Posts
    217

    Re: CommonControls (Replacement of the MS common controls)

    Yes , It is clear for now . Thanks Krool

  34. #2994
    New Member
    Join Date
    Feb 2021
    Posts
    2

    Re: CommonControls (Replacement of the MS common controls)

    Attached Files Attached Files
    File Type: zip ComCtlsDemo.zip (825.6 KB, 84 views)

    when i opened ComCtlsDemo on vb6.0 this error ocurred
    Someone knows the reason

    Error screenshot : Name:  ComCtlsDemo_Err.jpg
Views: 190
Size:  51.5 KB

  35. #2995
    Lively Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    104

    Re: CommonControls (Replacement of the MS common controls)

    Do you have the option "Break on all errrors" checked?, if the answer is yes, check the option "Break on unhandlled errors"

  36. #2996
    Lively Member
    Join Date
    Jan 2012
    Posts
    120

    Re: CommonControls (Replacement of the MS common controls)

    I've started the conversion of a project using the CC Replacements. Initial results are good, and the unicode support of these controls are very much appreciated!

    So far, I ran into two issues that I couldn't figure out:

    First
    ===
    In a frame I have 3 shapes, that visually show the status of something, traffic light style. Since shapes don't have events, I'm using the mousedown event of the frame to capture the X-, and Y-coordindates, and check those versus the position of the shapes. This worked fine with the original Frame object, but with the FrameW object, the X and Y that the event returns, don't correspond with the coordinates of the shapes. My guess is that a different scaling is used? Or am I missing something else?

    Second
    =====
    With the classic graphical style command button you could assign an image, and when the button was disabled, the image would be grayed out. There was no need to assign a DisabledPicture. With the CommandButtonW control, the image disappears completely when the button is disabled. Is this by design, and do I have to add a DisabledPicture, or am I missing something?


    All advice is appreciated! Thanks in advance!

  37. #2997
    Lively Member
    Join Date
    Jan 2012
    Posts
    120

    Re: CommonControls (Replacement of the MS common controls)

    Two more questions:

    #1. It seems that the Alignment of text in the TextBoxW doesn't work. Neither setting in the IDE, nor setting it at runtime in code gives another result than left align.

    #2. I have a statusbar with 5 panels. Panels 1, 4, and 5 are fixed. The remaining space is divided between panels 2 and 3. For the standard CC statusbar, I updated the width of panels 2 and 3 in the form resize event. When I do that now with the CCR statusbar, the width of the panels is not calculated correctly.

    My original code:

    Code:
        With brStatusBar
            .Panels(2).Width = (frmMain.ScaleWidth - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
            .Panels(3).Width = (frmMain.ScaleWidth - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
        End With
    I also tried with:

    Code:
        With brStatusBar
            .Panels(2).Width = (.Width - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
            .Panels(3).Width = (.Width - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
        End With

    Last, but not least, I also tried moving this to the form Paint event. Unfortunately to no avail.

    Any suggestions?

  38. #2998

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

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Erwin69 View Post
    First
    ===
    In a frame I have 3 shapes, that visually show the status of something, traffic light style. Since shapes don't have events, I'm using the mousedown event of the frame to capture the X-, and Y-coordindates, and check those versus the position of the shapes. This worked fine with the original Frame object, but with the FrameW object, the X and Y that the event returns, don't correspond with the coordinates of the shapes. My guess is that a different scaling is used? Or am I missing something else?
    I tested a shape in a FrameW control and the X and Y coordinates correspond correctly. It's origin is of course the FrameW. Like for the VB.Frame.
    Please provide demo showing otherwise.

    Quote Originally Posted by Erwin69 View Post
    Second
    =====
    With the classic graphical style command button you could assign an image, and when the button was disabled, the image would be grayed out. There was no need to assign a DisabledPicture. With the CommandButtonW control, the image disappears completely when the button is disabled. Is this by design, and do I have to add a DisabledPicture, or am I missing something?
    What do you mean? It is always better to have a DisabledPicture, instead of relying on the to gray out the Picture object by the control.

    Below is a picture object where the left side has Enabled property set to True and right side set to False in a CommandButtonW. (no DisabledPicture object used here)
    What's wrong with it? Please advise.

    Name:  CommandButtonW_Graphical_Disabled.png
Views: 91
Size:  1.7 KB

    Quote Originally Posted by Erwin69 View Post
    #1. It seems that the Alignment of text in the TextBoxW doesn't work. Neither setting in the IDE, nor setting it at runtime in code gives another result than left align.
    I cannot replicate it. Please provide demo.
    If you are using the OCX version, which version do you use?


    Quote Originally Posted by Erwin69 View Post
    #2. I have a statusbar with 5 panels. Panels 1, 4, and 5 are fixed. The remaining space is divided between panels 2 and 3. For the standard CC statusbar, I updated the width of panels 2 and 3 in the form resize event. When I do that now with the CCR statusbar, the width of the panels is not calculated correctly.
    This is complicated. I need a demo from you which has the MS statusbar and the VBCCR statusbar beneath (or each in a own Form) and showing the differences.
    Thanks

  39. #2999
    Lively Member
    Join Date
    Jan 2012
    Posts
    120

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool, thanks for the feedback. Find attached a small demo that shows the issues.

    #1. Clicking the colored circles should move the "selector box" to the one clicked. The messagebox shows the X and Y that are returned, which are of a totally different scale than the coordinates of the Shapes.

    #2. The 5 graphical buttons have no disabled picture assigned. Clicking the <Enabled> button on the right of the frame, displays all pictures. Clicking the <Disabled> button, causes them to disappear completely.

    #3. The three colored textboxes have been assigned the various align options. The text still aligns to the left in all three.

    #4. Both MS and VBCCR statusbars have been set up with 5 panels with widths of respectively 2000, 1275, 1440, 2000, and 2000. On initial load, the panels in both statusbars are aligned, but as soon as the form is resized, the VBCCR panels 2 and 3 are given widths that are too large.

    I'm using version 1.7.0.1 of the OCX.

    CCRTest.zip

  40. #3000

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

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Critical bugfix in the FrameW control.
    Mouse events were scaled to pixels instead of twips.

    Quote Originally Posted by Erwin69 View Post
    #1. Clicking the colored circles should move the "selector box" to the one clicked. The messagebox shows the X and Y that are returned, which are of a totally different scale than the coordinates of the Shapes.
    The ScaleMode of the UserControl was set to pixels instead of twips.
    This has no affects on the ContainedControls property since the container reports always in twips.
    However, this mis-setting led to wrong scaled values in the mouse events. (e.g. MouseDown)

    The problem should now be resolved for the VBCCR17.OCX (1.7.3)

    Quote Originally Posted by Erwin69 View Post
    #2. The 5 graphical buttons have no disabled picture assigned. Clicking the <Enabled> button on the right of the frame, displays all pictures. Clicking the <Disabled> button, causes them to disappear completely.
    I use the DrawState API with DSS_DISABLED when no DisabledPicture is available and the control has Enabled = False.
    However, it seems the API works better with DST_ICON and works not so good with DST_BITMAP.

    Just a note. DSS_DISABLED will treat a white color as transparent. So you can try changing the MaskColor to white. (your picture needs to be changed of course)
    Or best. You supply a proper DisabledPicture object..

    Quote Originally Posted by Erwin69 View Post
    #3. The three colored textboxes have been assigned the various align options. The text still aligns to the left in all three.
    The VB.TextBox will re-create the control when the Alignment property changes.
    However, the VBCCR TextBoxW uses SetWindowLong to change the Alignment.

    Reason is that setting ES_CENTER or ES_RIGHT upon CreateWindowEx causes problems for a multi-line edit control which has horizontal scrollbars.
    That's why it is set after CreateWindowEx via SetWindowLong.

    BUT, I just noticed that prior to Windows Vista (e.g. Windows XP) the ES_CENTER and ES_RIGHT bits are NOT modified-able.
    Even the comctl32.dll version 5.8x on Windows 7 (or Windows 10) does allow it.

    So, I am in a dilemma right now on this where I don't know how to react to...
    Last edited by Krool; Feb 13th, 2021 at 05:24 PM.

Page 75 of 77 FirstFirst ... 2565727374757677 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