- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do I turn a dialog control invisible at runtime in an API application?
Thanks,
David
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp]ShowWindow(GetDlgItem(hDlg, IDC_CONTROL), SW_SHOW)[/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying, I searched the help for 'visible', 'invisible' & 'show' but could not see anything (CVF6.6).
SW_SHOW is not mentioned in the help so I'm not sure what the parameters are.
Here I have some code to show controls 1 & 2 and hide controls 3 & 4 but it doesn't work maybe the parameters are wrong.
lret=SendMessage(hBmp(1),SW_SHOW,0,0)
lret=SendMessage(hBmp(2),SW_SHOW,0,0)
lret=SendMessage(hBmp(3),SW_HIDE,0,0)
lret=SendMessage(hBmp(4),SW_HIDE,0,0)
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you want to make a dialog control completely invisible (i.e. not draw it)?
If so, then I think you should use Jugoslav's suggestion that works ( I have tried it with an edit box in a dialog) namely:
use dfwinty ! contains parameters SW_HIDE etc.
use user32 ! contains interface blockfor ShowWindow
use dflogm ! defines types such as T_DIALOG
include 'resource.fd' ! source of control IDs such as IDC_CONTROL
type (T_DIALOG) Dlg
integer hWndDlg, hWNdControl
.....
iditem=???
if(iditem.eq.IDC_CONTROL) then
hWndDlg=Dlg%hWnd
hWndControl=GetDlgItem(hWndDlg,IDC_CONTROL)
iret=ShowWindow(hWndcontrol, SW_HIDE)
endif
To makethe window that is the control IDC_CONTROL visible, use
iret=ShowWindow(hWndcontrol, SW_SHOW)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
iret=ShowWindow(hWndcontrol, SW_HIDE)
and
iret=ShowWindow(hWndcontrol, SW_SHOW)
Are what are needed.
Looking back it's obvious.
Thanks,
David

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page