• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 440
  • Last Modified:

Making dialog in CFormView have a Client Edge

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
JediBecker
Asked:
JediBecker
  • 4
  • 2
  • 2
2 Solutions
 
JediBeckerAuthor Commented:
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
 
vadikCommented:
How did you enable the Statusbar?
0
 
vadikCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
JediBeckerAuthor Commented:
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
 
DanRollinsCommented:
>>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
 
JediBeckerAuthor Commented:
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
 
DanRollinsCommented:
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
 
JediBeckerAuthor Commented:
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

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.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now