Jump to content

Recommended Posts

Posted

I managed to change the font to Segoe UI, make it bold and make it slightly bigger, but I don't know if it's possible to also centralize the text in the tab?

Snippet:

; Font setting for all tabs
$MainTabCtrl = GUICtrlCreateTab(0, 0, 430, 580,$GUI_SS_DEFAULT_TAB)
GUICtrlSetFont($MainTabCtrl,14, 700, 0, "Segoe UI")

I searched the forum but "tab" "center" "text" isn't to be found in any titles.

I checked the Wiki page for "GUICtrlSetFont" and it doesn't mention setting the text to the left/center/right

https://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetFont.htm

TabTextCenter.png

Posted

I recomend to you at first check this:

 

and at second step ... take a look here:

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Moderators
Posted

TalesFromTheScript,

The best solution I have come across is to set the tab width to 0 and then the text appears centred:

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>

$hGUI = GUICreate("Test", 500, 500)

$MainTabCtrl = GUICtrlCreateTab(0, 0, 430, 580)
GUICtrlSetFont($MainTabCtrl, 14, 700, 0, "Segoe UI")

GUICtrlSendMsg ( $MainTabCtrl, $TCM_SETMINTABWIDTH , 0, 0)

GUICtrlCreateTabItem("tab0")

GUICtrlCreateTabItem("longer tab1")

GUICtrlCreateTabItem("tab3")

GUICtrlCreateTabItem("")

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...