SET RGB COLOR TEXT NTK_RGB(255,128,0) BACK NTK_RGB(100,100,100) @ 0,0 SAY HB_OemToAnsi("Tollbar Title") SIZE nHHB, nMaxCol; STYLE DT_SINGLELINE+DT_CENTER+DT_VCENTER; FONT NTK_GetStockObject(SYSTEM_FONT); INTO CONTEXT hDC
The background color ist : RGB(100,100,100) My problem is, that the buttons border color are not the same (see picture) I can't find our where I have to setup this color? In the command CREATE TOOLBAR FROM aTbBtnList, I dont see any thing!
AFAIK, only the NTK_OD_FREESHAPE button type allows full control on button features and behaviour. In your case, just add BACKCOLOR NTK_RGB(100,100,100) to each toolbar member, and replace your @ y,x CREATE TOOLBAR .... BUTTON TYPE NTK_BT_OWNERDRAWN/NTK_BT_STANDARD... with @ y,x CREATE TOOLBAR .... BUTTON TYPE NTK_OD_FREESHAPE...
I don't find any definition for NTK_OD_FREESHAPE ? I scanned the whole \Wntk4hrb directory
I think the background color of the buttons are the same as the main windows. But the buttons are placed over the title banner and do not take this color as background color! Code for the Title Banner: SET RGB COLOR TEXT NTK_RGB(255,128,0) BACK NTK_RGB(100,100,100) @ 0,0 SAY "Title Banner" SIZE nHHB, nMaxCol; STYLE DT_SINGLELINE+DT_CENTER+DT_VCENTER; FONT NTK_GetStockObject(SYSTEM_FONT); INTO CONTEXT hDC
Hi Otto, Lucas is right but was certainly talking about "NTK_BT_OD_FREESHAPE".
BTW, you cannot change certain parameters (e.g. bkg or border colors) when using NTK_BT_STANDARD or NTK_BT_OWNERDRAWN button type. Both are using a pre-defined theme. Indeed, buttons that use NTK_BT_STANDARD type are directly ruled by the MS-Windows default theme/manifest.xml. And buttons created with NTK_BT_OWNERDRAWN type use the NTK predefined theme & colors as declared in NTKBTN.ch
Hello Ab, Many thanks for your help I tried all version of parameters, only with NTK_BT_OWNERDRAWN I have a good result! I did some test by changing the background colors defines in NTKBTN.ch but without success. I give up. I leave my buttons like that. I will continue to learn the other functions of NTK. Regards Otto
Hi Otto, I agree NTK_BT_OWNERDRAWN is a quick and efficient way to get nice buttons with modern style. But it's nothing compared to the awsome possibilities of the powerful NTK_BT_OD_FREESHAPE buttons. Your imagination is the only limit! Maybe I could show you a couple tricks if you could post a zip with your PRG+Resources........... However you have tons of NTK tutorials that use NTK_BT_OD_FREESHAPE buttons. e.g. dGridView, Layer, BtnBmp, DemoNTKSkin, and so on.
Here are 2 quick samples that show how to use NTK_BT_OD_FREESHAPE buttons. Both are based on your original PRG+resources, only minors changes have been done. Now it's up to you to invent better styles. All is a matter of bitmap & imagination. HTH Ab,