Window is not getting repainted - Windows CE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fastestindian
    New Member
    • Aug 2009
    • 74

    Window is not getting repainted - Windows CE

    Hi,
    I am working windows CE application.

    I am opening a page which has Textbox in it.

    In that TextBox I am showing a text report.

    Previously the font of text was 'Tahoma' as system font was Tahoma too.

    But now i want to show report in 'Corier New' Font but I am facing new.

    I am opening the window using showDialog(). but that windows is showing the text with tahoma font.
    But if that windows loose focus and again gains. Its get repainted.

    so i have come to conclusion that when I open window using ShowDialog() window is not getting repainted. and I want to repaint it.

    So please help me in this as I have wasted too much time in this.

    Thanks and Regards,
    Sachin
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Which version of CE?

    You can force the window to be repainted by Invalidating the rect and updating the window.

    Comment

    • fastestindian
      New Member
      • Aug 2009
      • 74

      #3
      Version is CE 5.0
      Do you mean that when window gets loaded i need to call the invalidate() method in gotFocus() event?

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        I don't know in what method you should call invalidaterect and updatewindow, it depends on your design. But if you want the window to repaint first you must invalidate the region that you want repainted and then tell the window to repaint itself. This is done normally by the Windowing system automatically but there may be times when you want to do it explicitly, therefore MS provides APIs for you to do that.

        Comment

        • fastestindian
          New Member
          • Aug 2009
          • 74

          #5
          Will u elaborate more.
          like..which API's I should use..

          Thanks

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            Invaldaterect and updatewindow... .

            Comment

            • fastestindian
              New Member
              • Aug 2009
              • 74

              #7
              There was problem in base class.

              First time it was painting window from values from the base class which were readonly.

              I needed to change to base classes so that values from base classes get updated or editable and thus will write text in proper format at first instance.

              but anyway..thanks for ur replies

              Comment

              Working...