Solved

Help! How to change the tilebar of a CFormView?

Posted on 2000-02-25
4
254 Views
Last Modified: 2013-11-20
Hi,

I want to change the title of a CFormView,i used SetWindowText, but it does not work. any one knows how to do it?

Thanks  a lot!
0
Comment
Question by:greenbird
  • 2
4 Comments
 
LVL 3

Expert Comment

by:akalmani
ID: 2560396
HI !!
  In OnInitialUpdate() use that SetWindowText("ajfk"); or else get the pointer to CFormView whenever u want to change the title use that pointer and call SetWindowText("kladf");
 
0
 
LVL 8

Accepted Solution

by:
VinExpert earned 5 total points
ID: 2560477
Hi,

I consider that U have 2 child views. Forst one is CFirstView and second one is CSecondView. Ur App class is CMyApp. Now follow the steps.

1. Hava a variable in the app class .h file to know witch child R U opening say
int m_iChildNo; which will be initialised to 0 in the app class consructor.

2. Then in the OnInitialUpdate function of first view access that variable using and as
CMyApp *pApp = (CMyApp *)AfxGetApp();
pApp->m_iChildNo = 1;

3. Then in the OnInitialUpdate function of second view access that variable using and as
CMyApp *pApp = (CMyApp *)AfxGetApp();
pApp->m_iChildNo = 2;

4. Map the SetTitle() function to the CMyDoc class and change it as
void CMyDoc::SetTitle(LPCTSTR lpszTitle)
{
CMyApp *pApp = (CMyApp *)AfxGetApp();
      
switch(pApp->m_iChildNo)
{
case 1:    //First view title
      lpszTitle = "Green";
                break;
case 2:      //Second view
                lpszTitle = "Bird";
                break;
}
CDocument::SetTitle(lpszTitle);
}

Thats it. It will work.

Hope this helps U.
VinExpert
0
 

Author Comment

by:greenbird
ID: 2560567
Hi,

thanks for all the help u had given. i will try it out later, if i got any problem, will come again :)

thanks a lot! and wish u a happy weekend!
0
 

Author Comment

by:greenbird
ID: 2567721
Hi,

hmmm it does not work... the title bar of the CFormView is still: untitled - myapp.... how come?
thanks!
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 35
Adapt this command to show who installed 29 108
Complete beginner needs help making a cron job 9 117
mapBully challenge 6 135
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ā€¦
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

803 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