Windows Ribbon Framework: How to change font face and size?

后端 未结 3 1259
情话喂你
情话喂你 2021-02-14 16:07

How do you change the font face and font size used by the Windows Ribbon Framwork\'s UIRibbon?

The font used by the ribbon does not match the font the user has chosen as

相关标签:
3条回答
  • 2021-02-14 16:11

    Based on the behavior of Windows 7 Paint, this appears to not be possible. :)

    0 讨论(0)
  • 2021-02-14 16:24

    I'm not exactly sure.. You're using the Windows Ribbon Framework in Delphi and got this strange behavior?

    I've just started playing with the Framework but the Ribbon respects my preferences.

    TUIApp = class(TInterfacedObject, IUIApplication)
    ...
    gApp: TUIApp;
    uiFrame: IUIFramework;
    ...
      CoCreateInstance(CLSID_UIRibbonFramework, nil, CLSCTX_INPROC_SERVER, IUIFramework, uiFrame);
    
      if Succeeded(uiFrame.Initialize(Handle, gApp)) then
      begin
         if not Succeeded(uiFrame.LoadUI(GetModuleHandle(nil), PChar('SIMPLERIBBON_RIBBON')))then
            sleep(5);
      end;
    

    This is all what i do in my test project.

    With 9pt: alt text

    And with 14pt: alt text

    Perhaps you change the wrong option? I've set the font size of the "Menu" element.

    If you have further questions just ask...


    I've just checked Win7 Paint. It does respect the user preferences. Therefore i guess you did something wrong or really changed the wrong option.


    As requested the screenshot: alt text

    It looks likes we did the same. This is pretty strange...

    0 讨论(0)
  • 2021-02-14 16:31

    If if you've actually tried to be helpful, and read all the way down to here, you'll realize this is the correct answer: it's not possible. So if you want a free 300 rep, you add that as an answer.

    Since I can't post that as an answer (George got in there first :)), and since you seem to desperately need some kind of solution, I'm going to post the only other helpful answer or suggestion I can give to solve your problem: use a different ribbon control. You don't say why you're using this implementation instead of Delphi's own, or even one of the other Microsoft ones.

    Two options are:

    • The inbuilt Delphi TRibbon control. I haven't used this in any publicly released apps, but I have in my own small / test programs and it is a little buggy in places. (I've seen odd drawing problems in the shortcut bar thing on the title bar, for example.) This may have improved in Delphi XE. It is possible it suffers from a similar bug. However, it's shipped with Delphi, "free" if you have Delphi, native code, VCL, and being a VCL component comes with the source so you can fix things if necessary.

    • The TMS ribbon control. I haven't used it but I have used another TMS control. That control is good, and their support fixes bugs quickly. (I've had confirmation of a bug in a day, so "immediately" counting timezones, and a new build released in a few days.)

    I believe other component vendors may make ribbon components, and I do remember reading of someone making a SpTBXLib modification containing ribbon controls, but I haven't heard much about them. My suggestion is to use the TMS ribbon.

    0 讨论(0)
提交回复
热议问题