Change Popup menu font

Discussion forum about all things Team Developer 5.x and 6.x
gm10qt747
France
Posts: 3
Joined: 10 May 2017, 15:01
Location: Paris France

Change Popup menu font

Post by gm10qt747 » 11 May 2017, 08:31

Hello,

Does anyone knows how to change Popup menu font ?
I use SalMenuSetFont but it does not work :-(
SalMenuSetFont seems to work only for Item menu but not for Popup menu

Many thangs

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2385
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Change Popup menu font

Post by Jeff Luther » 11 May 2017, 16:36

Well, Help says that
SalMenuSetFont sets the font to be used by a menu item or popup
so I would recommend that you write a small test case, zip it and attach to a reply to this discussion. That way we can look at it, run it and perhaps have a better way of helping you.

For any test case where certain steps are needed, be sure to provide us the list of steps we need to do to reproduce the issue or problem you are describing.

NOTE TOO... that the last sentence in TD Help for this function states that
For Win32, updates to top-level menu objects are not immediately visible. To display the changes, call SalMenuUpdate or SalDrawMenuBar
Did you make that Sal call as well?
Jeff Luther @ PC Design
Palm Springs, California

EwaldP
Austria
Posts: 351
Joined: 07 Mar 2017, 08:00
Location: Austria

Re: Change Popup menu font

Post by EwaldP » 12 May 2017, 06:28

Hi,

this should work.

Set lv_nPopup = SalGetMenu( hWndForm )
Set lv_bOk = SalMenuSetFont( hWndForm, 'popup1', 'Microsoft Sans Serif', 10, FONT_EnhItalic )
Call SalMenuUpdate( hWndForm, lv_nPopup )
Ewald P. Palmetshofer
EDV-Hausleitner GmbH
4020 Linz
www.edv-hausleitner.at

gm10qt747
France
Posts: 3
Joined: 10 May 2017, 15:01
Location: Paris France

Re: Change Popup menu font

Post by gm10qt747 » 12 May 2017, 09:03

Hello,

Thanks you guys for your reply.
EwaldP, the codes you gaved me works :D
But now I have a problem, the menu I want to change is my MDI window menu. And when I call SalCreateWindow to open a window form frm1 my MDI window menu loses the font change.
I add your code on SAM_CreateComplete of frm1 to change again the menu font but SalMenuSetFont return false.

Here is my code

Set hMenu = SalGetMenu( hWndMDI)
Set bReturn = SalMenuSetFont( hWndMDI, 'File', 'Times New Roman', 10, FONT_EnhNormal )
Set bReturn = SalMenuUpdate( hWndMDI, hMenu )

Any idea ?

Thanks
Soung

Livius
Romania
Posts: 1
Joined: 31 Oct 2020, 06:05
Location: Bucuresti, Romania

Re: Change Popup menu font

Post by Livius » 05 Jan 2021, 14:26

If still you have this issue than set the MDI property, "Persist Child Menus" to YES

Return to “General Discussion TD 5.x and 6.x”

Who is online

Users browsing this forum: [Ccbot] and 0 guests