Connecting Tech Pros Worldwide Forums | Help | Site Map

Window is not getting repainted - Windows CE

Member
 
Join Date: Aug 2009
Posts: 33
#1: Aug 6 '09
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's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,393
#2: Aug 6 '09

re: Window is not getting repainted - Windows CE


Which version of CE?

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

http://msdn.microsoft.com/en-us/library/ms927613.aspx
Member
 
Join Date: Aug 2009
Posts: 33
#3: Aug 7 '09

re: Window is not getting repainted - Windows CE


Version is CE 5.0
Do you mean that when window gets loaded i need to call the invalidate() method in gotFocus() event?
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,393
#4: Aug 7 '09

re: Window is not getting repainted - Windows CE


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.
Member
 
Join Date: Aug 2009
Posts: 33
#5: Aug 10 '09

re: Window is not getting repainted - Windows CE


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

Thanks
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,393
#6: Aug 10 '09

re: Window is not getting repainted - Windows CE


Invaldaterect and updatewindow....
Member
 
Join Date: Aug 2009
Posts: 33
#7: Aug 21 '09

re: Window is not getting repainted - Windows CE


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
Reply