June 30, 2024, 05:28:45 PM

News:

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


Is Control Visible

Started by ckoehn, October 25, 2014, 09:48:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ckoehn

Is there a way to see if a control is set to @SWSHOW on the windows form?

Say for instance I do a "SHOWWINDOW w1,@SWHIDE,20",  and a "SHOWWINDOW w1,@SWSHOW,10".

I need something like IsVisible(10) and it will return a true or false.  I can't find any way to get the visible state of a control on the form.

Later,
Clint

Brian

How about the:

INT = ISWINDOWCLOSED(win as WINDOW)

Detects whether a window or dialog is closed or not. Returns true if open

Brian

ckoehn

October 25, 2014, 10:46:13 AM #2 Last Edit: October 25, 2014, 11:01:40 AM by ckoehn
Thanks for your interest Brian.  I needed to see if a control on a form was visible or not, not just the form.

Here is what I finally found out... windowssdk.inc must be included for GetWindowLong function and GWL_STYLE and WS_VISIBLE constants.

IF ((GetWindowLong(GETCONTROLHANDLE(w1,ControlID),GWL_STYLE) & WS_VISIBLE) !=0)   'control is visible

It looks like this worked.

Later,
Clint

LarryMc

Or, if you are using $include "windowssdk.inc"

if IsWindowVisible(GETCONTROLHANDLE(w1,ControlID))
print "I see you"
else
print "Where are you?"
endif


Just remember, being "visible" and you being able to see it are two different things.
Like if the control is "visible" but is covered by another window.

This is true with my way and when you check the WS_VISIBLE style flag.


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

ckoehn

Thanks LarryMc,

I just need to know if the control is visible on the window, not necessarily "see" it, like the window could be hidden but the control visible on the window.

Will try your way...

Later,
Clint