CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    45

    Status bar problem

    I have created a status bar on my Child windows to show the amount of Scaling in the window. This works fine until the scale value reached 10, and the value is replaced by characters. For example, at a scale of 17 the out is "Scale value : A"
    Could somebody please tell me what's wrong?
    Thank you,
    Sean.





  2. #2
    Join Date
    Apr 1999
    Posts
    45

    Re: Status bar problem

    This is where my problem is

    >>>CString StatusMsg("Zoom :");
    >>>StatusMsg += static_cast<char>('0' + Zoom);

    Zoom is an INT that represents the scale factor. I took this code from an example in a book, but in this example the maximum value of Zoom is 8, so this code works fine. How do I edit it so it will display values of Zoom greater than 9?
    Thanks again,
    Sean.


  3. #3
    Join Date
    Apr 1999
    Posts
    45

    Re: Status bar problem - sample code i'm using.

    Here is the sample code that I'm using :

    ******************************

    // Get the frame window for this view
    CChildFrame* viewFrame = static_cast<CChildFrame*>(GetParentFrame());

    // Build the message string
    CString StatusMsg("Zoom :");
    StatusMsg += static_cast<int>('0' + m_Zoom);

    // Write the string to the status bar
    viewFrame->m_StatusBar.GetStatusBarCtrl().SetText(StatusMsg, 0, 0);

    ******************************



  4. #4
    Join Date
    May 1999
    Posts
    116

    Re: Status bar problem - sample code i'm using.

    CString StatusMsg;
    StatusMsg.Format("Zoom :%d", m_Zoom);




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured