?
Solved

Making dialog in CFormView have a Client Edge

Posted on 2003-03-03
8
Medium Priority
?
436 Views
Last Modified: 2013-11-20
Hi there,

Awhile ago I created a Formview-based app without the status bar enabled.  Today I went back and enabled it, and in so doing realized that there is no "separator" between it and the rest of the window.  

After playing a bit, I saw if I check the "static edge" checkbox in the Extended Styles for the dialog that the formview is based on, I get a separator of sorts.  But what I really want is a client edge.  However, checking that checkbox has no effect.

The odd thing is I then used the MFC App Wizard to create a new FormView-based app (with no content) and by default, it has the client edge around the dialog in the window.  But despite my best efforts, I cannot get it in my previously-created app.

I've tried changing PreCreateWindow in my CFormView-based class to this:

BOOL CWarrantsToolView::PreCreateWindow(CREATESTRUCT& cs)
{
     // TODO:Modify the Window class [...]
      //  the CREATESTRUCT cs

     cs.dwExStyle |= WS_EX_CLIENTEDGE;
     return CFormView::PreCreateWindow(cs);
}

This has no effect however.

Any ideas?

Thanks,

-Dave
0
Comment
Question by:JediBecker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 

Author Comment

by:JediBecker
ID: 8059894
Incidentally, I just tried adding:

    ModifyStyleEx(0,WS_EX_CLIENTEDGE);

to the InitialUpdate() call in the CFormView-derived class, but that didn't work, either.
0
 
LVL 1

Expert Comment

by:vadik
ID: 8061306
How did you enable the Statusbar?
0
 
LVL 1

Assisted Solution

by:vadik
vadik earned 200 total points
ID: 8061342
I did the same thing... I created a Formview-based app without the status bar enabled, and after that I enabled the StatusBar so added this code snippet:

---------------- MainFrame.cpp --------------


static UINT indicators[] =
{
     ID_SEPARATOR,           // status line indicator
     ID_INDICATOR_CAPS,
     ID_INDICATOR_NUM,
     ID_INDICATOR_SCRL,
};

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{

...................

     if (!m_wndStatusBar.Create(this) ||
          !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)))
     {
          TRACE0("Failed to create status bar\n");
          return -1;      // fail to create
     }

........................


     return 0;
}

------------------ MainFrame.h ----------


class CMainFrame : public CFrameWnd
{

...............

protected:  // control bar embedded members
     CStatusBar  m_wndStatusBar;

.................
};

This is working correctly. Sorry for my English....

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:JediBecker
ID: 8065747
Hi Vadik -- thanks for the interest.  In the application I'm trying to fix, I have those same exact code snippets, but there is NO client edge around the formview in the main-frame.  So I'm still not sure where to go next.

Like you, if I create a new project without a status-bar initially enabled, and then go through those steps it also works for me.  Actually, *any* new formview-based app I create with the wizard, regardless of if I have the statusbar enabled or not when I create it, always has the formview with a client-edge in the mainframe.

But the question remains: what is going on that is keeping me from getting it in the existing application?

Thanks,

-Dave
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 8095020
>>Actually, *any* new formview-based app I create... always has the formview with a client-edge in the mainframe.

Unless I misread, doesn't that explain the problem?  Isn't the problem related to the view and NOT the status bar?

Examine the difference between the view in the simple AppWizard-created case and your program.

Is this SDI or MDI?

-- Dan
0
 

Author Comment

by:JediBecker
ID: 8104017
Hi Dan,

It is SDI.

You are probably right about the status bar vs. the view.  I did make a project and compare the view in it to my view, and can find no significant code changes.  I had originally had my view multiply derived from another class, but I took that out to try to "revert" it to the formview in the app-wizard application, but that didn't help.

Incidentally, I'm running this on XP, but with "Windows Classic" look and feel.

Thanks,

-Dave
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8106085
Sorry, I haven't played with XP skins.  There is every chance that XP interprets some style bit differently.  You could use Spy++ to examine all of the styles and extended styles for both/all windows.

-- Dan
0
 

Author Comment

by:JediBecker
ID: 8912238
Well, I never got this figured out, but I have since moved on and don't need it.  I wanted to close it out and thank you two for your help in trying to figure it out, so I just accepted those answers.

Thanks!

-Dave
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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