May 08, 2024, 11:06:49 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


SetWindowcolor one parameter or two

Started by TexasPete, May 29, 2008, 05:48:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TexasPete

I have been looking at the SetWindowColor. The examples I have seen are for the following
SetWindowColor window,rgb(128,200,100). In the users guide it appears that it allows for foreground and background.
When I enter something similar to following SetWindowColor window, RGB(128,123,134),RGB(200,234,200)
I then try to compile and I get an error. Am I that dense? What is the proper way to set foreground and background
TexasPete

LarryMc

Don't know what made you think you can set foreground and background colors using SETWINDOWCOLOR.
From the EBasic Help file:
QuoteSyntax

SETWINDOWCOLOR(win as WINDOW,colr as UINT)

Description

Changes the background color of a window.

Parameters

win - Window

colr - New background color

Return value

None

Remarks

None

Example usage

SETWINDOWCOLOR mywindow, RGB(0,0,0)
Maybe you were confusing it with SETCONTROLCOLOR
QuoteSyntax

SETCONTROLCOLOR(win as WINDOW,id as INT,fg as UINT,bg as UINT)

Description

Changes the color of a control.

Parameters

win - Window or dialog containing control.

id - Identifier of control.

fg - New foreground color.

bg - New background color.

Return value

None.

Remarks

The foreground color is used for the text color in most controls. @SYSBUTTON controls do not support color changes. Rich Edit control have their own text coloring functions.  Checkbox and radio button controls with the style BS_PUSHLIKE do not support color changes.

See Also: CONTROL

Example usage

SETCONTROLCOLOR mydlg, 7, RGB(255,255,255), RGB(0,0,0)

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

TexasPete

Larry thanks, I must have been confusing it with setcontrol. I am switching over from liberty basic and I need to think a little differently from lb syntax.
I am playing around with eb and as I do I am finding out that it is a much more powerful language. It actually is a lot better than lb.
Sincerely,
TexasPete

aurelCB