News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how send to back a control?

Started by RHL, March 28, 2012, 02:20:14 AM

Previous topic - Next topic

RHL

hello people, I have a question  :(
I have several controls but my problem is that some controls are above others and let me know how I can send a control to back at runtime?
for example:



I want send to back the control label, thanks people

qWord

Using the WS_CLIPSIBLINGS-style for the controls should solve your problem.
FPU in a trice: SmplMath
It's that simple!

RHL

But I want do in runtime , thanks

qWord

Quote from: RHL on March 28, 2012, 08:10:56 AM
But I want do in runtime , thanks
why? give us more information.
Have you tried SetWindowPos()?
FPU in a trice: SmplMath
It's that simple!

RHL

qWord thanks u, well what I really want is set a control the background STATIC class to load an image in it, and move that
control STATIC as background under all but my problem is that control is above some  :(

qWord

You may try this: add the WS_CLIPSIBLINGS flag to the STATIC's style using Get/SetWindowLong(hStatic,GWL_STYLE [,style]) and then invalidate the whole dialog/window using InvalidRect(hWnd,0,1).
FPU in a trice: SmplMath
It's that simple!

jj2007

The order of creation may play a role. Try creating the static first.

donkey

As qWord said, use SetWindowPos specifying HWND_BOTTOM, that should work for you.

invoke SetWindowPos, hStatic, HWND_BOTTOM, 0,0,0,0,SWP_NOMOVE + SWP_NOSIZE + SWP_SHOWWINDOW
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

i created this little app to demonstrate a static image in the background
it also demonstrates the use of tables to create controls and windows
i could have used the same class/WndProc for the child windows
but RHL intends to have vastly different controls in each, so i seperated them

i used 24-bit BMP images, so the thing is too big for the forum   :P

EDIT: link replaced in next post


dedndave

ok - a bit of an improvement
in the previous version, i set button fonts individually after creation
i wasn't happy with it - lol

in this version...
if the control is either a Static or a Button, i set the font as it is created
that makes for much cleaner code

also, i changed from 24-bit images to 256-color images
so, the thing fits on the forum board   :P
if you wanted to do some kind of "vector" images (lines, etc), 256-colors would be plenty

hfheatherfox07

Quote from: dedndave on April 02, 2012, 02:33:42 AM
ok - a bit of an improvement
in the previous version, i set button fonts individually after creation
i wasn't happy with it - lol

in this version...
if the control is either a Static or a Button, i set the font as it is created
that makes for much cleaner code

also, i changed from 24-bit images to 256-color images
so, the thing fits on the forum board   :P
if you wanted to do some kind of "vector" images (lines, etc), 256-colors would be plenty

Nice I seen something like this but  the picture changes with the clock on the CP...
So after say 6:30 PM you would see the sun set image after 12AM a night image ... I wonder how to do that .....
I know how to get system time soooo.....
very cool  :U