Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Visible <--> Invisible 'Edit Box'

Posted on 1998-10-03
1
Medium Priority
?
293 Views
Last Modified: 2013-11-20
I would like to know how to change an 'Edit Bot' style
to invisible, from inside the c++ code. I have a dialog
box with 3 buttons. Depending on which button is pushed,
a dialog box pops up with some edit box hidden, some not.
( I want to use a precreated edit box id as 'IDC_EDIT1'. )

I would also like to know how to change the title for a
precreated dialog box from inside program code.

Thank you, Tomas
0
Comment
Question by:tko092397
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 400 total points
ID: 1322897
To show edit box

GetDlgItem(IDC_EDIT1)->ShowWindow( SW_SHOW ) ;

To hide edit box

GetDlgItem(IDC_EDIT1)->ShowWindow( SW_HIDE ) ;

To enable edit box

GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE) ;

To disable edit box

GetDlgItem(IDC_EDIT1)->EnabbleWindow(TRUE) ;


Normally you will wish the edit box to be disabled whenever it's hidden


To change dialog title

SetWindowText( "New Title" ) ;


Any of the above will work anywhere in the dialog class provided the dialog is up (e.g. not in constructor but in response to any message such as button being clicked)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question