CommonControls (Replacement of the MS common controls) - Page 41-VBForums
Page 41 of 41 FirstFirst ... 3138394041
Results 1,601 to 1,612 of 1612

Thread: CommonControls (Replacement of the MS common controls)

  1. #1601
    Member
    Join Date
    Feb 2015
    Posts
    36

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Due to the fact that the default FaceName in vb6.exe is limited to 13 chars there seems to be no way to define "Microsoft Sans Serif", right?
    So we could define "Segoi UI" but would need to life with FontSize of 8 instead of 9?
    To be consistent with newer versions of Windows, Segoe UI 9pt would be better.

    Quote Originally Posted by VBNetMatrix
    I did tutorial in a Vb6 project and I started a blog about all thing I want to share about Vb6...
    The blog is "under construction" but project is available...
    Does your VB6 'hack' change the font used in a VB6 app's menu ?

  2. #1602
    Member
    Join Date
    Feb 2015
    Posts
    36

    Re: CommonControls (Replacement of the MS common controls)

    Krool,

    In the Toolbar control you can change the font and this works fine. But the font used in the dropdown 'ButtonMenus' doesn't change. Is there any way to set this font ?

  3. #1603
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    16,190

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VB6 Programming View Post
    To be consistent with newer versions of Windows, Segoe UI 9pt would be better
    Probably not a bad choice. That font appears to be available since Vista. If an app, using that font were shipped to XP (for sake of argument), the font would be changed to something else unless font is also shipped.

    I created a test app in Vista with a font I know wasn't installed on Win10. When opened in Win10, that font was changed to Arial. I don't know how VB (or system) selected Arial other than some system font-fallback algo. The plus side to this is that Arial is at least an Open/True type font which would scale better with DPI awareness.

    If hacking the vb6.exe, suggest considering how far back one wants to support backward compatibility with fonts. Other options for fonts that do not use hacking vb6.exe are:

    1) Whenever a form is added to your project, first thing to do is change the font on the form. Then, with most controls, the added control can inherit the form's font.

    2) Create a form with the desired font and save it to VB's \Template\Forms folder and name it something like "Default.frm". Now you can replace the base form VB gave you with that one (via the selection window) and can select that new default whenever you want to add additional forms to the project. Similar solution for MDI forms: \Template\MDIForms folder.

    In any case, font-fallback will be in play if the font you chose is not installed on the systems the app is run on. It's a shame VB didn't buffer the embedded font name within vb6.exe with full 32 characters.

    My only concern for hacking VB6.exe would be that it would fail to open if an uninstalled font was hacked into the exe. Maybe it would just default to Arial or something else? Maybe it will crash? Probably should verify that by hacking a completely bogus font name: BogusFont (suffixing null chars or spaces to fill it out to 13 chars)

    Edited & FYI: using NotePad to enter a bogus font in an existing .frm file did NOT prevent the form from loading. The font, however, was changed to Arial (Win10). Maybe Arial would be a more consistent choice instead of Segoe UI?

    One more edit... Hacked vb6.exe myself and provided a bogus font and VB defaulted to Arial. I then re-hacked it and provided a valid font and all went well. There are two locations in the exe where "MS Sans Serif" is listed, I replaced both instances, filling out the 13 characters with null chars as needed. I chose Arial over Segoe UI, but Segoe UI worked also. I personally prefer Arial as the default. Always hack a copy of the exe. And be pretty sure of the font you want. If you revisit this in a year, you may forget that the space allocated for the font is 13 characters. The font displayed in the exe won't show as 13 characters any longer if you selected a font with a shorter name.
    Last edited by LaVolpe; Yesterday at 01:35 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classic Enthusiasts? 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} {GDI+ Classes/Samples} {Unicode Open/Save Dialog} {Icon Organizer/Extractor}
    {VB and DPI Tutorial} {XP/Vista Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #1604
    Member
    Join Date
    Feb 2015
    Posts
    36

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    Probably not a bad choice. That font appears to be available since Vista. If an app, using that font were shipped to XP (for sake of argument), the font would be changed to something else unless font is also shipped.
    Segoe UI has been the default Windows font since Vista, and has shipped with Office since Office2007 (so is often found on XP PCs too). The Microsoft logo uses the Segoe font.

    I personally prefer Arial as the default.
    I like Arial too. It was just that Microsoft chose Segoe for Windows that made me choose it.

    Create a form with the desired font and save it to VB's \Template\Forms folder and name it something like "Default.frm". Now you can replace the base form VB gave you with that one (via the selection window) and can select that new default whenever you want to add additional forms to the project. Similar solution for MDI forms: \Template\MDIForms folder.
    That's how I do it. And I also save a Project (and Form) into the \Template\Projects folder, so I don't need to replace the base form each time.
    But the Menu font remains as MS Sans Serif 8pt.

  5. #1605

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    724

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    I have 2 issues here with listview

    1 - when setting the property "usecolumnchevron" to true and autosizing the last column to header , these bugs occur

    a - the header caption disappears
    b - the width of the column gets too wide and the arrows "chevron" appear
    a: If the column headers are wider than the client area and can't be displayed all together the chevron button is shown.
    It is normal behavior that that caption where the chevron button currently is will not be shown.
    b: I already explained, but again: When doing autosize to the last columnheader it is sized to right side of client edge.

    Quote Originally Posted by Hosam AL Dein View Post
    when you set a splitbutton to a column and you manually re-position it , it loses the property and it is set to the other column which replaces it
    Seems to be an MS bug as other column properties (e.g. CheckBox) is shifting properly. The splitbutton though will stick to current column order and thus shifts to another column.
    It seems worth to make some internal extra effort to address that bug. Bug is noted.

    Quote Originally Posted by Hosam AL Dein View Post
    also in linklabel , the font is not affected in design time . run the project once , now it will be drawn in both run time and design time
    Fixed. Thanks. It was not an bug per definition, but linklabel did not refresh after WM_SETFONT so a RedrawWindow was necessary afterwards.

    Quote Originally Posted by Hosam AL Dein View Post
    it is in linklabel , when set to transparent this bug happens
    Fixed. Thanks. It was not an bug per definition, but linklabel needed the dummy WM_PAINT after creation before the intial caching transparent brush.
    Info: On all controls the caching of the transparent brush can be renewed with '.Refresh'. So keep in mind whenever background changes and you want to update the transparency make an .Refresh.

    Quote Originally Posted by VB6 Programming View Post
    In the Toolbar control you can change the font and this works fine. But the font used in the dropdown 'ButtonMenus' doesn't change. Is there any way to set this font ?
    The dropdown 'ButtonMenus' uses the system font.
    Again, the .ButtonMenus property is meant for simple and rapidstart use. If you want to have custom font do as following:
    Don't set any ButtonMenu in .ButtonMenus, instead handle the event 'ButtonDropDown' and create your own menu there. (e.g. custom drawn PopupMenu)

    -

    Edit: OCX was also updated conerning LinkLabel.
    Last edited by Krool; Yesterday at 03:31 PM.

  6. #1606
    Addicted Member
    Join Date
    May 2011
    Posts
    159

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Due to the fact that the default FaceName in vb6.exe is limited to 13 chars there seems to be no way to define "Microsoft Sans Serif", right?
    So we could define "Segoi UI" but would need to life with FontSize of 8 instead of 9?

    Well... yes that's an issue for Microsoft Sans Serif... the other solution would be to rename a font to a smaller name, this can be achieve with a tools... problem is you'll need to distribute that font with your EXE because I doubt the destination computer would "recognized" it as the original font...

    However, on my machine, the program give me 126 other fonts to choose from, including SegoUI and Arial... wich are both "acceptable"

    as for the size, I didn't find a place in the vb6.exe where they store it. I assume, 8 is the minimal font size of ms sans serif and that might be why that size was selected. something like MinSizeOfFont("Ms Sans Serif") worth exploring since I noticed the font "Ms Sans Serif" was also stored at another adress in the exe, I'll make some test to validate that theory.

    Did you tried the Vb6.exe font changer from my blog yet ?

  7. #1607
    Addicted Member
    Join Date
    May 2011
    Posts
    159

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VB6 Programming View Post
    To be consistent with newer versions of Windows, Segoe UI 9pt would be better.
    Agree but it doesn'T seem to be possible for the moment. I'm exploring something to allow it... I'll keep you informed.

    Quote Originally Posted by VB6 Programming View Post
    Does your VB6 'hack' change the font used in a VB6 app's menu ?
    No but I have achieved this by modifying ressource inside the program.

    This would be the topic of another program since it's really 2 differents things... When I'll get time I'll make the documentation on how to achieve that and post it on my blog.

  8. #1608
    Addicted Member
    Join Date
    May 2011
    Posts
    159

    Re: CommonControls (Replacement of the MS common controls)

    Thanks Lavolpe, you have pertinent observation.

    Quote Originally Posted by LaVolpe View Post
    Probably not a bad choice. That font appears to be available since Vista. If an app, using that font were shipped to XP (for sake of argument), the font would be changed to something else unless font is also shipped.
    SegoUI is the Microsoft Choice as "default" font for many thing including Visual Studio 2010 and up.

    Quote Originally Posted by LaVolpe View Post
    I created a test app in Vista with a font I know wasn't installed on Win10. When opened in Win10, that font was changed to Arial. I don't know how VB (or system) selected Arial other than some system font-fallback algo. The plus side to this is that Arial is at least an Open/True type font which would scale better with DPI awareness.
    You are right. It's a System behavior (herited from Win95). Microsoft made it a System behavior with the arrival of Web (WWW). Some web page made for MacOS user wasn't showed properly because of font difference. First, the family font is analyze, then the font attribute like "Serif", "StrikeThrough", etc... then the closest font available is selected. Arial will be selected more then 85% of the time but sometime Helvetica got elected.

    Quote Originally Posted by LaVolpe View Post
    It's a shame VB didn't buffer the embedded font name within vb6.exe with full 32 characters.
    Yeah, they simply did: OurVarDefaultFontName = "Ms Sans Serif" and the terminated Null

    Quote Originally Posted by LaVolpe View Post
    My only concern for hacking VB6.exe would be that it would fail to open if an uninstalled font was hacked into the exe. Maybe it would just default to Arial or something else? Maybe it will crash?
    Won't crash... I tested it first. I would not have offered this solution without knowing it was safe. However since this is only for the IDE and since nobody will "share" their vb6.exe because it contain your serial number encrypted (install Vb6 fresh on a machine, save the vb6.exe, uninstall and install back, you'll get a different vb6.exe binary each time)


    Quote Originally Posted by LaVolpe View Post
    Always hack a copy of the exe.
    pretty sure you meant BACK (up) instead of HACK

    Quote Originally Posted by LaVolpe View Post
    If you revisit this in a year, you may forget that the space allocated for the font is 13 characters. The font displayed in the exe won't show as 13 characters any longer if you selected a font with a shorter name.
    That's why it is safer with the program I made. I save the font as Left(strFontName & String(13,0)), 13)


  9. #1609
    Addicted Member
    Join Date
    May 2011
    Posts
    159

    Re: CommonControls (Replacement of the MS common controls)

    about: \Template\Forms folder

    Quote Originally Posted by VB6 Programming View Post
    That's how I do it. And I also save a Project (and Form) into the \Template\Projects folder, so I don't need to replace the base form each time.
    But the Menu font remains as MS Sans Serif 8pt.
    But you need to select "new project" and your template right?

    My Vb6 is set to open a new project everytime instead of the select menu
    Did you find a way to open your selected template by default ?

    I'm looking for a way achieve this. Sadly the design of the IDE in itself was poorly think. There is limited option of personalisation

  10. #1610
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    16,190

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VbNetMatrix View Post
    That's why it is safer with the program I made. I save the font as Left(strFontName & String(13,0)), 13)
    I just overwrote the 13 bytes. Nothing fancy. Think you should warn user if a font name is > 13 characters. You don't want to truncate the font name. If you do, the hacked font won't be what they expected. Just a suggestion.

    Regarding my concerns about crashing, etc. If you noticed my edited comments in my reply, already confirmed that it won't crash and it will select another font if a the hacked font isn't installed. I added those comments after I hacked my copy of vb6.exe to test it.

    P.S. I tried searching the exe to see if I can find where the font size of 8 is set. Didn't spend a ton of time on it, but if there's a LOGFONT structure in there somewhere, I didn't see it. It is possible that there is no value set. LOGFONT.lfHeight can be set to 0, meaning: default height.
    Insomnia is just a byproduct of, "It can't be done"

    Classic Enthusiasts? 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} {GDI+ Classes/Samples} {Unicode Open/Save Dialog} {Icon Organizer/Extractor}
    {VB and DPI Tutorial} {XP/Vista Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  11. #1611
    Addicted Member
    Join Date
    May 2011
    Posts
    159

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    P.S. I tried searching the exe to see if I can find where the font size of 8 is set. Didn't spend a ton of time on it, but if there's a LOGFONT structure in there somewhere, I didn't see it. It is possible that there is no value set. LOGFONT.lfHeight can be set to 0, meaning: default height.
    Sorry I had missed your edited comment... I started to answer and I had to leave, when I came back, I just finished my answer and posted it.
    as for the font size... you're probably right...

    what we need is a NEW IDE !!!

    We need to learn how to "load an OCX at run time" to emulate the IDE behavior... and to run in memory for debugging like the IDE... The rest is simply an editor
    loool.

    p.s. did you found a new dizzy yet ?

  12. #1612
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    16,190

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VbNetMatrix View Post
    p.s. did you found a new dizzy yet ?
    Yep, custom made for my engine specs. Will take about another 2 weeks to finish and get here. Can't wait, cold weather is not that far out and the Mustang is just sitting in the garage, collecting dust, while waiting for it. 50 year old cars are money pits, but its worth it to some of us.

    Krool, sorry. Won't hijack your thread talking about muscle cars.
    Last edited by LaVolpe; Yesterday at 11:38 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classic Enthusiasts? 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} {GDI+ Classes/Samples} {Unicode Open/Save Dialog} {Icon Organizer/Extractor}
    {VB and DPI Tutorial} {XP/Vista Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Page 41 of 41 FirstFirst ... 3138394041

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.