Page 3 of 4 FirstFirst 1234 LastLast
Results 81 to 120 of 140

Thread: [RESOLVED] LED.OCX & Windows 11 Pro

  1. #81
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Here, this is my very latest version of the thing. I forget if this is what I last posted or not, but here it is:
    Attached Files Attached Files
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #82

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    Ahhh!!! Wonderful!! I missed that, but my eyes are really burning right now. I was looking for size and my eyes never settled on LEDSIZE - lol.

    I also need to read the link, way back when, you left for designing user controls. I have loaded your control in VB6 in design mode and do not see how you are making the round LED (which is PERFECT by the way). The form associated with it just looks like a large form with a time control on it and no drawing of the LED. I started to look at the code behind the user control and my head started throbbing. I will look at it further tomorrow.

    Hopefully, I can link a bunch of them together as a control array and assign each one its own index value.

  3. #83
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Ahhh, yeah, I left you messages about how to get started with User-Controls. Both Eduardo and I sort of got carried away with this thing.

    The latest version is using a Windows graphing library called GDI+, which does a very nice job of drawing things. However, it's fairly advanced to use. In this latest version, that's what's being used to draw both the LED dot and the border around it. The fact that it's done with GDI+ is why it looks so nice.

    If you want to start learning about User-Control, my post #18 is a much better starting place. That version of the control uses standard VB6 drawing objects and a label control on the custom User-Control ... and it's far less code in it. I don't think it even has any API calls in it.

    It works fine, it's just not nearly as "pretty" as the latest version.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  4. #84
    PowerPoster
    Join Date
    Feb 2006
    Posts
    23,796

    Re: LED.OCX & Windows 11 Pro

    I doubt that "Cumulative Update for SP6" is SP6 itself.

    Worse yet, it sounds like the thing they also called "Security Rollup" that actually broke a lot of controls, inserting off-by-one errors in many places that could cause program crashes and data corruption. The security issues it was meant to address only mattered for OCXs for deployment as part of IE web pages anyway.

    I can't even find a Microsoft download for SP6 any more. The newest one that I have here is Vs6sp6d.exe and that may have been the last one.

  5. #85
    PowerPoster
    Join Date
    Nov 2017
    Posts
    2,152

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by daveyk021 View Post
    Hello Elroy,

    I stumbled with acmsetup added the files and folders as need and got VB6 Installed again on this bench computer.

    When I try to install the SP6 service pack, I am getting this:

    That message indicates that what you were trying to install at that point was not VB 6.0 SP6, but instead, a cumulative update for devices already running VB 6.0 SP6. I see you posted below that you found the actual SP6 and got that installed, but I wanted to mention this for your own sake and for anyone else down the road that might be reading this.

  6. #86

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    A little anomaly I found, maybe you can splain. Here I added two control, each with a different index. Looks fantastice:
    Attachment 185890

    I move the control and it goes blank unless I resize it:
    Attachment 185891

  7. #87
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    I just looked and I forgot to put a "Caption" property in that post #18 version (to change the label's caption), but it might be a good exercise for you to figure out how to do that.

    Basically, a Public Get and Public Let Property named Caption, set the Label's caption with the incoming Public Let's argument. And then also read & write them to the control's property bag.

    I'm willing to just continue on with this thread if you'd like to try and understand user-controls more. Personally, I think they're fun.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  8. #88
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by daveyk021 View Post
    A little anomaly I found, maybe you can splain. Here I added two control, each with a different index. Looks fantastice:
    Attachment 185890

    I move the control and it goes blank unless I resize it:
    Attachment 185891
    Dave, these forums have a bug regarding attaching pictures. You have to go to "Go Advanced" (before posting) for it to always work correctly. And I can't see your pictures.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  9. #89
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Also, it's always best to save your pictures as PNG files if you can do that. JPGs also work, but PNGs are better.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  10. #90
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Ahhh, I figured it out from your notes.

    Upon runtime, it all works fine ... so there's that.

    When you move the control, it's just not getting a refresh during design-time. If you close-and-reopen the form, that also fixes it.

    I'll look at it though. Without doing subclassing, I'm not positive I can detect those moves though. Also, I disabled the blinking during design-time. If I enabled that, that'd also fix it.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  11. #91

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by Elroy View Post
    Dave, these forums have a bug regarding attaching pictures. You have to go to "Go Advanced" (before posting) for it to always work correctly. And I can't see your pictures.
    Name:  New LED Test 1.jpg
Views: 77
Size:  5.3 KB

    Name:  New LED Test 2.jpg
Views: 68
Size:  7.8 KB

    If I change any parameter of the control, it comes back. If I move the control, it looks like it does in the second picture.

  12. #92

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    What I can do is leave the background color different than the form. That way, I can always see where the LED is at. Then during the load event, change the background color to match the form background.

    I do not think it will take me that long to adapt the programs that use it to your user control. It is still funny that in the "home" machine, the old .ocx control works perfect. Well, I can not waste any more energy in trying to figure that out. It is what it is and your control is most probably a lot more powerful.

    BTW, good night, I must head upstairs to the TV and what not.

    Dave

  13. #93
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    I fixed it. No subclassing needed. Just the following line in the Repaint event:

    Code:
    
        mbFullRefresh = mbFullRefresh Or Not RunTime
    
    
    New version attached.

    LedUserControl.zip
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  14. #94

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    Yes, it is fixed!! Perfect. Now I must head up; thank you so kindly, and good night.

  15. #95
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by daveyk021 View Post
    What I can do is leave the background color different than the form. That way, I can always see where the LED is at.
    I think that's a good idea.

    Quote Originally Posted by daveyk021 View Post
    I do not think it will take me that long to adapt the programs that use it to your user control.
    Good to hear.

    Quote Originally Posted by daveyk021 View Post
    It is still funny that in the "home" machine, the old .ocx control works perfect.
    Personally, I think it's better to have all the source code to everything, and have it all in one project (if possible).

    Quote Originally Posted by daveyk021 View Post
    BTW, good night, I must head upstairs to the TV and what not.
    Have a nice evening.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  16. #96

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    Good morning Elroy,

    I will put an image of my finished form with your control when I have it updated.

    The hard of an array in Frame container is that I can not copy Paste as VB6 will not link them then even if I rename the control and set the correct index, plus it disappears in the frame. So, I must add the control and then do all the color and size changes, index change, and everything else. I wish I could just paste, change the index and caption.

    Anyway, working on it a bit now, then I must get to doing some real paying work in the shop.

    Dave

  17. #97
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Good morning Dave,

    Well, another option is to edit the code of the custom UC (being sure to close your other forms first), and edit the defaults.

    Here's the code you'd edit:

    Code:
    Private Sub UserControl_InitProperties()
        mnLedSize = 300!
        mlState = Blinking
        mlBlinkRate = 1000&
        mlBackColor = vbButtonFace
        mlBackStyle = vbTransparent
        mlBorderColor = vbBlack
        msCaption = "Caption"
        mlLedColor = vbRed
        mlBorderWidth = 1&
        mbThreeD = True
    End Sub
    Changing any of those would change the initial values of things when placing a new control on your form.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  18. #98
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    And the Font is a bit different. If you wish to change the default caption font, just open the UC's designer form (closing other forms first), and then change the font of the UC's designer form. That's where the font is stored for this UC (to be used for the caption).
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  19. #99
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    You may ask why I keep saying to "close other forms first". If you simultaneously have a form open that has a custom UC on it, and also have that custom UC open for editing, the IDE sometimes gets confused and changes all those custom UCs on the other form to PictureBoxes. If your other forms are just sitting in the Project Window (unopened), this never happens.

    And this sort of makes sense, considering all the things the Intellisense is trying to do (show you all the properties and methods of everything).
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  20. #100

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    I do see that there is not an "Enable" parameter. That is not a big deal, but I typically, in the load event, or by default, have the LED not enabled, until after the program has made the serial connection to the instrument under test.

    So the form comes up, you can see all the controls, but they are all disabled except for the the Serial Communication Port pull-down. Once a connection to the instrument under test, has been established, all controls are enabled. Typically that is done to any control with a given TAG.

  21. #101
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Ahhh, ok, I'll add that. Give me a few minutes.

    I'm going to disallow blinking if it's disabled, and I'm also going to add other new properties: Disabled-LED-Color & Disabled-Caption-Color. I'll just use light gray for those defaults.

    Also, if you tell me what you'd like for the size defaults, I'll change those too.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  22. #102

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    Here is what the LED portion of my test screen looks like:
    Name:  Frame Before Move.jpg
Views: 58
Size:  71.1 KB

    At one point, and I have not been able to duplicate, I moved the frame, and all the controls "hashed out".

    As far as the enable, I easily take care of that with a global ControlsEnable Boolean variable. So don't worry about it.

  23. #103

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by Elroy View Post
    Ahhh, ok, I'll add that. Give me a few minutes.

    I'm going to disallow blinking if it's disabled, and I'm also going to add other new properties: Disabled-LED-Color & Disabled-Caption-Color. I'll just use light gray for those defaults.

    Also, if you tell me what you'd like for the size defaults, I'll change those too.
    Too cool; thank you. Light grey disabled is grey. Defaults? I seen to like a boarder size of 2, size 200. I'm not sure of color. I have these at yellow, but, I will probably change that to clear, then during a test, blink yellow, after test, if the test passes, it will be solid green or solid red if the test fails.

    Dude, you really came up with something great here. You should sell this! I need to compensate you. In my shop it is just me and these control and test programs I write make my life easier. I plan to keep the shop going for at least two and a half years yet, before going full hobby. Life gets shorter and shorter, I probably should quit when I'm 64.5. Right now, it is still fun! I'm not sure if they make me more efficient, or give me more time to watch YouTube when I should be working - lol.

    Let me know your email.

  24. #104

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    I guess not "clear" as such but to the form background color.

  25. #105

    Thread Starter
    Lively Member
    Join Date
    Sep 2022
    Posts
    68

    Re: LED.OCX & Windows 11 Pro

    Okay, it hashes out once I go to your control to look at all the options
    Name:  Frame Hashed Out.jpg
Views: 58
Size:  43.1 KB

    I'm not sure what it take to un-hash them.

  26. #106
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Ok, working on it. Another few minutes.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  27. #107
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Ok, here's the lastest.

    Here's what I've done:
    • Added an "Enabled" property.
    • Added a "CaptionDisabledColor" property.
    • Added a "LedDisabledColor" property.
    • Added a "LedOffColor" property.
    • Changed "BorderWidth" property's new default value to 2.
    • Changed "LedSize" property's new default to 200.
    • Changed "LedColor" property's new default to vbYellow.

    Ok, you also mentioned the BackColor property, and maybe having a transparent option. That's not as totally easy as it might seem. The reason is that I don't necessarily know the container's back-color until runtime. So, here's what I can do. I can give you a Transparent property, but it will only work during runtime. Would you like that?

    And, a related question. When the LED is blinking, but off, should it also use that container's back-color? Or should it stick with it's own LedOffColor? Or, should I have another "LedBackStyle" property (opaque/transparent) that determines that?

    Work attached.

    p.s. No payment needed. I'm a 70yo retired guy who just enjoys trying to keep my mind sharp. I don't mind giving you my email though, but I'd rather just stick with this thread regarding this LED work.
    Attached Files Attached Files
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  28. #108
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by daveyk021 View Post
    Okay, it hashes out once I go to your control to look at all the options
    Name:  Frame Hashed Out.jpg
Views: 58
Size:  43.1 KB

    I'm not sure what it take to un-hash them.
    Ok, that's why I keep saying to close your regular form before messing with the UC's code (or designer form). When it does that, just close that form, close the UC stuff, and then re-open the form ... and you're usually ok.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  29. #109
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,446

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by Elroy View Post
    having a transparent option
    UserControl:

    BackStyle = 0
    ClipBehavior = 0

    Code:
    Private Sub UserControl_HitTest(X As Single, Y As Single, HitResult As Integer)
        HitResult = vbHitResultHit
    End Sub

  30. #110
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Ok, I've added two more properties:

    1. ControlBackStyle
    2. LedOffStyle

    Both have two options, Transparent or Opaque.

    If ControlBackStyle is Opaque it used the BackColor property. If ControlBackStyle is translucent, it uses the UC container's BackColor property.

    The LedOffStyle is a bit trickier. Here's the Select Case statement for what it does:

    Code:
    
                Select Case True
                Case mlLedOffStyle = styleOpaque:       iFillColor = mlLedOffColor
                Case mlControlBackStyle = styleOpaque:  iFillColor = mlBackColor
                Case Else:                              iFillColor = Ambient.BackColor
                End Select
    
    
    That only executes when the LED is off (but not disabled), such as blinking off, or just turned off. Otherwise it's filled with the LedColor value.

    Work attached.

    Eduardo: I just vertically center both the LED and the caption, so I don't really worry about clipping. And also, the caption wraps, so horizontal clipping doesn't really make sense. Regarding vertical clipping, I suppose I could monitor changes to both the LED and the caption's font, and resize accordingly, but the caption wrapping would make even that difficult. That caption just complicates auto-sizing, and that's why I just didn't bother with it. Just let him work it our during designing.
    Attached Files Attached Files
    Last edited by Elroy; Sep 26th, 2022 at 12:39 PM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  31. #111

  32. #112
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,446

    Re: LED.OCX & Windows 11 Pro

    I mean, "transparent" being transparent.

  33. #113
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by Eduardo- View Post
    I mean, "transparent" being transparent.
    Ahhh, yeah, that's another level. I believe you're using "regions" to get that done. Again, with the caption, that gets rather complex. I'll let Davey ask for that before I throw myself into that one.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  34. #114
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,446

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by Elroy View Post
    Ahhh, yeah, that's another level. I believe you're using "regions" to get that done. Again, with the caption, that gets rather complex. I'll let Davey ask for that before I throw myself into that one.
    No, the whole control is the region, like it is now.
    Attached Files Attached Files

  35. #115
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by Eduardo- View Post
    No, the whole control is the region, like it is now.
    Well, that was easy enough. I saw the commented out lines, and the new lines.

    Dave, not sure you'll use it, but Eduardo has given you the ability for a more true transparency, in the case where your container has a picture in its background.

    He used my latest code and patched it up, so it's got all of my latest changes. I've taken his work and I'm calling it the "latest".
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  36. #116
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Ok, one more change.

    If both ControlBackStyle=transparent, and LedBackStyle=transparent, you now get the picture in the center of the LED, as it should be.

    The new Select Case for that (when the LED light isn't shining):

    Code:
    
                Select Case True
                Case mlLedOffStyle = styleOpaque:       iFillColor = mlLedOffColor
                Case mlControlBackStyle = styleOpaque:  iFillColor = mlBackColor
                Case Else:                              iFilled = False
                End Select
    
    
    Work attached (including Eduardo's mod):
    Attached Files Attached Files
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  37. #117
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Dave,

    Just as an FYI, I know you're trying to get some design work done.

    For ALL of these recent changes, to implement them, all you have to do is to open the UC's code window, delete all the code, and then paste the code from the latest version. (Again, closing all your other forms when you do this.)

    But, done this way, all the changes will just automatically appear on all your design work with this UC.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  38. #118
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,446

    Re: LED.OCX & Windows 11 Pro

    Yes, but there was an issue in the first version that I posted, I fixed that soon but you had already downloaded.
    The issue is that the control is not painted at runtime until it blinks.

    Here is your latest version but with the fix.
    Attached Files Attached Files

  39. #119
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    8,404

    Re: LED.OCX & Windows 11 Pro

    Quote Originally Posted by Eduardo- View Post
    Yes, but there was an issue in the first version that I posted, I fixed that soon but you had already downloaded.
    The issue is that the control is not painted at runtime until it blinks.

    Here is your latest version but with the fix.
    Ahhh, perfect. You just moved it up to where the property is changed.

    Davey, you keeping up?

    Also, I've got to run some errands. I'll almost certainly check in later.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  40. #120
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,446

    Re: LED.OCX & Windows 11 Pro

    BTW, JFYI, with the HitTest event you could just make the hit when the user clicks on the LED if you want.

Page 3 of 4 FirstFirst 1234 LastLast

Tags for this Thread

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