- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I want to change the visible flag from some controls of my QuickWin application from visible to invisible at runtime. The reason is, that our program should ship to a customer and we want that he is not able to change certain values or settings.
When editing the resource file with Visual Studio I can set any control the visible flag to false and so that control wont be visible when I run the program.
I could use the disabled flag at runtime of course, but then the controls are still visible and the customers wants to know, why he is not able to change them.
Thanks in advance,
Markus
I want to change the visible flag from some controls of my QuickWin application from visible to invisible at runtime. The reason is, that our program should ship to a customer and we want that he is not able to change certain values or settings.
When editing the resource file with Visual Studio I can set any control the visible flag to false and so that control wont be visible when I run the program.
I could use the disabled flag at runtime of course, but then the controls are still visible and the customers wants to know, why he is not able to change them.
Thanks in advance,
Markus
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use ShowWindow API:
[fortran]use ifwin logical:: visible integer:: show ... show = merge(SW_SHOW, SW_HIDE, visible) ret = ShowWindow(GetDlgItem(Dlg%hWnd, IDCONTROL), show)[/fortran]Notes:
- This will work only while the dialog is alive, i.e. after DlgModal. If you want it at initialization, you have to call it from a dialog-initialization callback (DlgSetSub(DLG_INIT))
- IDCONTROL is the ID of the control you want to show/hide.
- I love the scalar MERGE intrinsic, which serves as a one-liner IF/ELSE statement. Adopt at will ;-)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use ShowWindow API:
[fortran]use ifwin logical:: visible integer:: show ... show = merge(SW_SHOW, SW_HIDE, visible) ret = ShowWindow(GetDlgItem(Dlg%hWnd, IDCONTROL), show)[/fortran]Notes:
- This will work only while the dialog is alive, i.e. after DlgModal. If you want it at initialization, you have to call it from a dialog-initialization callback (DlgSetSub(DLG_INIT))
- IDCONTROL is the ID of the control you want to show/hide.
- I love the scalar MERGE intrinsic, which serves as a one-liner IF/ELSE statement. Adopt at will ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Damn, GetDlgItem was the function I was searching for...
I was thinking about using the ShowWindow function but I didnt found a way to get the hWnd of a control. This happens when you dont program that much in QuickWin any more :-)
The merge intrinsic is cool, reminds me of the old Fortran code of my boss, when he used ifstatements in one line.
Markus
I was thinking about using the ShowWindow function but I didnt found a way to get the hWnd of a control. This happens when you dont program that much in QuickWin any more :-)
The merge intrinsic is cool, reminds me of the old Fortran code of my boss, when he used ifstatements in one line.
Markus

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