CodeDocu.com

 

 

Task I want to write a character on a button, which is not visible in Ascii.

These are the special characters of the Segoe UI MDL2 character set.

You can select and copy the characters directly in the special characters table and paste them directly into the text of a button.

The characters require the Unicode character set, which means that if you query the button for Button.Caption, only one question mark will be returned in vba.

 

Solution:

You can query the individual characters with ChrW (number) or write with AscW (number) as a character

If AscW(BtnExpander.Caption) = -8175 Then

        '----< Caption is Down >----

        BtnExpander.Caption = ChrW(-8176)   'set Up

..

 

Special characters in Windows 10

Access: insert special characters in vba

 

 

Vba code for reading and writing the button text with Segoe MDL2 special characters

Private Sub BtnExpander_Click()

    '------------< BtnExpander_Click() >------------

    'Button Caption with Segoe Mdl Charakter for up and down

    'Segoe UI Mdl2

    '-8176= up

    '-8175= down

 

 

    If AscW(BtnExpander.Caption) = -8175 Then

        '----< Caption is Down >----

        BtnExpander.Caption = ChrW(-8176)   'set Up

        ctlNotiz.Height = 744               '2 rows

        '----</ Caption is Down >----

    Else

        '----< Caption is Up >----

        BtnExpander.Caption = ChrW(-8175)   'set Down

        ctlNotiz.Height = BtnExpander.Height '1 row

 

        '< adapt details heigth >

        Section(0).Height = 1

        '</ adapt details heigth >

        '----</ Caption is Up >----

    End If

    '------------</ BtnExpander_Click() >------------

End Sub

 

Button with Segoe Mdl to expand an input field.

The button text is adjusted with

BtnExpander.Caption = ChrW(-8176)   'set Up

ctlNotiz.Height = 744               '2 rows

 

Access: insert special characters in vba

 

Button with Segoe Mdl to close.

The button will be reset with         

BtnExpander.Caption = ChrW(-8175)   'set Down

 

Access: insert special characters in vba

 

The Segoe Mdl2 characters are also grouped in groups under the website

[Lnk "https://microsoft-programmierer.de/Sonstiges/Web/Icon/Segoe-Mdl2-Symbole-zusammengefasst?2432" /]

Access: insert special characters in vba


Software Entwicklung Stuttgart NĂ¼rtingen
Suche Projekte C#, WPF, Windows App,ASP.Net, vb.Net, WinForms, SQL Server, Access, Excel