Solved

Visible <--> Invisible 'Edit Box'

Posted on 1998-10-03
1
254 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 100 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 156
WinWaitActive parameters 12 31
sumDigits challenge 9 96
wordappend challenge 8 84
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now