Results 1 to 12 of 12

Thread: Win 10 1083 - Easily Duplicatable

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    3

    Re: Win10 1803 - Any VB6 impacts to report?

    I found a bug and don't know how to fix it since 1803.
    It's very easy to reproduce.
    Create a new project and add one checkbox to an empty form.
    Set the appearace to Flat and the Value to 2. The text is still
    visible but the checkbox is invisible. Sometimes it's shown in the IDE but
    if you run the project you don't see the checkbox.
    Any suggestions how to fix this without 3D?

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Win 10 1083 - Easily Duplicatable

    I manifest my IDE for common controls v6. I do not experience the problem you have while in design and running in the IDE. But I do experience that once the project is compiled to exe (no manifest).

    Now if I add an application manifest for common controls v6 before compiling, the problem went away once compiled.

    I think that including a manifest is the workaround.

    P.S. Welcome to the forums
    Last edited by LaVolpe; Jul 15th, 2018 at 02:39 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    373

    Re: Win 10 1083 - Easily Duplicatable

    Yes, this is another quirk of Win 10's.

    A easy solution is to explicitly set its default value on Form_Activate, e.g. Check1.Value = vbChecked or Check1.Value = vbUnchecked. To maintain its grayed out status, add Check1.Enabled = False.

    While we are here, I recap the other Win 10 quirks I had encountered so far:

    (1) For those Button controls which Style property is "Standard", change it to "Graphical", and change its BackColor back to my original one (&H00C0C0C0&) -- becaise it had been changed to White automatically under Win 10. It had been a pain that I had to go through all individual Forms in the project.

    (2) Avoid setting a tooltiptext in this manner: xxx.ToolTipText = "", then xxx.ToolTipText = "Color value is so and so". This will cause a severe blinking of ToolTipText on Win 10. There has never been such a behaviour prior to Win 10. Remarks: An example for having 'xxx.ToolTipText =""' is that if an image has a large area of the same color, you get a ToolTipText of pixel color under the Mouse only once, despite your mouse has been moved to 3 inches away. 'xxx.ToolTipText =""' is thus used to force a new display as and when the user moves the mouse. On a system before Win 10, the old code is still applicable alright, but not on Win 10.
    Edited:
    See Posting #10
    Last edited by Brenker; Jul 17th, 2018 at 11:52 PM. Reason: Reduce quirk count from 3 to 2, see #10

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Win 10 1083 - Easily Duplicatable

    @Brenker: Form.Width is a poor option since the width is dependent on the border style. Form.ScaleWidth is a better option. Of course if you meant ScaleWidth, then okie doke.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    373

    Re: Win 10 1083 - Easily Duplicatable

    LaVolpe,

    The way I use Form's Width, not Scalewidth, has its history here. Not too long ago, most of my program users didn't have large monitors, and their sizes varied greatly among them. At the design time I had to take this factor into consideration, i.e. I had to set a minimum possible Form Size which would cater to the needs of most of the users, yet able to accommodate the essential controls inside the Form, leaving some controls to be availed only to users who have a larger screen (menus pertaining to the unavailed controls are still accessible irrespective of the screen size). So a minimum Form Size is set.

    Users who have a larger screen can maximize the Form or just drag to resize it any time. Under these circumstances, I had to place some code lines in Form_Resize:
    Code:
    If Me.Width <= m_MinFormW Then Me.Width = m_MinFormW
    If Me.Height <= m_MinFormH Then Me.Height = m_MinFormH
    You can see that a problem exists from the outset. Now if the Form has a PictureBox which Align property is set "Align Left" and serving as a container for some toolbox tools, then the calculation of net usable area in terms of ScaleWidth becomes complicated as and when a user drags to resize the Form.

    Following the above said, I naturally use Width, not ScaleWidth, in the calculations for positioning some controls on the right size of the Form. This proves alright upto Windows 7. The only thing I need to do is to ascertain IsScreenThemed(). If yes, then I make an adjustment of 8 pixels accordingly.

    I had in my previous posting a "- 8" extra adjustment on Win 10; actually if I make the above-said IsScreenThemed() call and relying on its result, then I don't need to do the said extra adjustment. It is because I had been told/misled that "on Win 10 it is no longer themed" that I stopped making the said IsScreenThemed() call. (If IsCreenThemed() is called, it will return True.)

    But you are right that ScaleWidth should better be used in general. Actually when I position controls inside a PictureBox, I refer Scalewidth, not Width, of the PictureBox.

    Brenker

     
    Last edited by Brenker; Jul 15th, 2018 at 09:56 PM.

  6. #6
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    373

    Re: Win 10 1083 - Easily Duplicatable

    Here is yet anther Win 10 quirk.

    The attached ZIP contains a test project, with Form1 and Form2. Form1 has a comand button to invoke Form2, that is all. Both forms have a "minimum form size" constraint, i.e. the Form_Resize event would restrict the forms to their minimum size of 12000 x 9000 twips if you try to make it smaller. The project runs fine on XP, Vista and Win 7, but not Win 10. On Win 10, you can drag to resize the form, either one, to a bigger size, but if you drag in an opposite direction to make it smaller, you will be stopped at the minimum size set, then, after you release your mouse and try to resize it to a bigger size again, you won't be able to so this time.

    To test the project, you have to compile it first, then run its EXE.
    Attached Files Attached Files

  7. #7
    gibra
    Guest

    Re: Win 10 1083 - Easily Duplicatable

    Quote Originally Posted by LaVolpe View Post
    @Brenker: Form.Width is a poor option since the width is dependent on the border style. Form.ScaleWidth is a better option. Of course if you meant ScaleWidth, then okie doke.
    I agree 100%.
    I use ScaleWidth and ScaleHeight. I never use Width and Height.
    From Windows 98 to Windows 10 (1803).

  8. #8
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    373

    Re: Win 10 1083 - Easily Duplicatable

    First of all, we have to realize that this thread is about Win 10 quirk, not on Width v ScaleWidth. Because LaVolpe and I know each other since long, dating back to PSC time, and in vbForums we often discuss graphic stuff, mostly centering on fundamentals (the farest to go is upto GDIplus, not involving any 3rd party DLL or OCX), such as PCX compression, ICC Profile conversion, etc, so I appreciate it when he raises the Width v ScaleWidth point on "just in case" basis. I have no doubt that LaVolpe would know my point as soon as he sees my explanation in the specific case.

    Things should have settled at that. However, if one tries to be dogmatic inuanting that ScaleWidth should always be used, and Width should be avoided in any case, then I must point out that it is not the case:

    (1) There are scenarios in which ScaleWidth may not be the better choice, as explained in my earlier posting.

    (2) There are also circumstances under which Width, not ScaleWidth, is to be used. In another program of mine, the Form being in use has only Width property, no ScaleWidth property. Why I choose to use this kind of Form? The question is irrelevant , and it is beyond this thread. To simply put, I use this kind of Form because it serves me the best, e.g. I can open an Animated PNG file and select several frames to be loaded to my main screen in one stretch and then I can compare two frames side my side; I can view both a TGA image and a TIFF image conveniently on the same screen at the same time, I can at any point of time invoke a full fledged Icon Editor to load a couple of PNGs and/or ICOs from there (see the main menus in the appended screenshot) ....

    In a situation like this, Width is to be set in the earlier-said form size constraint, not ScaleWidth.

    Edited:
    Please read Posting #10
    Attached Images Attached Images  
    Last edited by Brenker; Jul 18th, 2018 at 07:29 AM.

  9. #9
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Win 10 1083 - Easily Duplicatable

    @Brenker, don't think you are going to convince anyone that using Form.Width,Form.Height is appropriate for positioning controls on a form as you mentioned in Post #3. Form.ScaleWidth,Form.ScaleHeight should be used in every case I can think of.

    Regarding post #5
    Following the above said, I naturally use Width, not ScaleWidth, in the calculations for positioning some controls on the right size of the Form. This proves alright upto Windows 7. The only thing I need to do is to ascertain IsScreenThemed(). If yes, then I make an adjustment of 8 pixels accordingly.
    You wouldn't need to go through all those hoops if you were using ScaleWidth/Height vs Width/Height to position controls. To position a control on the right side of a form, I see no reason at all to worry about the form's external width because the internal scalewidth is all I'm concerned about. No need to worry about some magic number buffer or whether a form is themed or not. Calculating form size, on the other hand, is a different topic, but positioning controls were being discussed.

    Regarding post #6. I have no problems resizing the sample form(s). Can make larger, then reduce size until your code forces minimum size, then make larger, etc, etc. No problems on my Win10 machine. Any way, post #6 has nothing to do with using form dimensions for positioning controls.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  10. #10
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    373

    Re: Win 10 1083 - Easily Duplicatable

    LaVolpe,

    You have convinced me that except for a Form which doesn't have a ScaleWidth property, referring ScaleWidth is good enough as far as positioning of cotrols on the right side is concerned. For testing I got rid of all "Aligned" containers and all other items, added only a few buttons and referred ScaleWidth for alignment, and this proved to be working fine. Sorry for the hassle. (Remarks: My form size constraint shall remain, I will keep my existing Width approach code lines for now since it is working okay - but I should reduce the Win 10 quirk count from the earlier said "3" to "2". Although themed and unthemed screens yield a different ScaleWidth x ScaleHeight area calculation, that is a separate issue that I have to deal with.)

    How about a Form with Width property only (no ScaleWidth property)? (see Edited below)

    Regarding #6, here is yet another example of the "strange phenomenon" about Win 10. But it won't surprise me at all even if you confirm to me that you are running EXE. Earlier on, I mentioned the "severe blinking" case, however, on the PC of one of the users (a programmer you know) there is no such blinking. I inquired about it, asking him if this had anything to do with "a Win 8 upgraded to Win 10 PC" v "a newly purchased PC", he said that "it seems every machine got a different Win 10" (his own program also has many users) -- that was about a month ago. Anyway, the 3 quirks (reduced to 2 now per first paragraph) I mentioned did occur on my Win 10 (plus the last one I mentioned, 3 now). The last one in #6 by itself is new to me - for this one I tested many times on my Vista, Win 7 and Win 10, and I had tried different ways on Win 10 trying to change the existing behavior, but no luck.

    Brenker


    Edited: Controls on a Form without ScaleWidth is self-algined anyhow, hence there is no worry about placement of an individual control such as a Button (its container is self-aligned).
    Last edited by Brenker; Jul 18th, 2018 at 07:40 AM. Reason: Replace texts, after some more testings on clean Form

  11. #11
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

    Re: Win 10 1083 - Easily Duplicatable

    I thought ALL forms had a Scalewidth/Scaleheight property. Certainly mine do.

  12. #12
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    373

    Re: Win 10 1083 - Easily Duplicatable

    Steve Grant,

    I was referring the MDI Form which has Width only. But, per my "Edited" comment above, controls on a Form without ScaleWidth is self-algined anyhow, hence there is no worry about placement of an individual control such as a Button (its container is self-aligned).

    Although my Width approach is also working okay, it is a result of code piled up over the years, not as simple as ScaleWidth approach - per suggestions of LaVolpe and Gibra above.

    Brenker

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