473,513 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OnPaint is missng between MouseDown and MouseUp (C# Compact framework)

2 New Member
Hello All,

I am working with Device Application( Compact framework) C#

I have a class which creates grid with numbers on it some thing like shown below

------------
| 1 | 2 | 3 |
------------
| 4 | 5 | 6 |
------------
| 7 | 8 | 9 |
------------
| 0 |
------------

Each cell is Rectangle object ( Rectangle array drawn on panel)
I just want to highlight only the key clicked (same effect as in windows calculator - On mouse down color should change and on mouse up normal color should be displayed)

For this i am doing something like this

bool pushed;

OnMouseDown()
{
pushed = true;
Invalidate();
}

OnMouseUp()
{
pushed = false;
Invalidate();
}


OnPaint(...)
{
....... /// some code
if(pushed)
{
Fill the selected/clicked rectangle with different color
}

.........// some code
}


Problem facing:
For some clicks, key highlight don't work in device application( compact frame work). But in windows application it works properly !!!

Usually when i click on a key, the order should MouseDown -> Onpaint - > MouseUp [ Onpaint calling in middle because of Invalidate in mouse down]

But some times, this order goes wrong in device application [compact framework] like MouseDown -> MouseUp [ OnPaint is missed] Because of this click highlight doesn't work.

Any help on this?
Dec 7 '10 #1
2 2853
GaryTexmo
1,501 Recognized Expert Top Contributor
Take this with a grain of salt because I've never developed in the compact framework before, but you might be able to manual force a paint on your mouse down and mouse up events.

I believe you can do with with the Invalidate() method.
Dec 8 '10 #2
pshilparani
2 New Member
Thanks for your reply GaryTexmo..

But calling Invalidate() in MouseDown event is not sufficient in WinCe environment [ Atleast in my case where i am trying paint specific region [rect] on a panel control ]. Because call to OnPaint by the Invalidate() will be ignored as soon i get MouseUp event.

I fixed this issue by forcing the paint by calling Update() in MouseDown event which will force immediate paint of invalidated regions like below.

OnMouseDown()
{
pushed = true;
Invalidate();
this.Update();
}
Dec 9 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4950
by: boble | last post by:
Sorry, it's may be off topic ;_((( The following article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k3/ht ml/winmob03.asp states that a.. Microsoft Windows .NET...
0
2584
by: Earle Oxner | last post by:
We are developing an application on PocketPC2002 platform and we are trying to make webservice calls using HTTPS. HTTP works fine but HTTPS does not work. The same code which doesn't work on...
2
2835
by: Duncan | last post by:
I am using the evaluation version of CE.NET 4.1. I had also installed the release version of the Compact Framework. I uninstalled the CE.NET 4.1, and then realized I needed it again and...
1
2494
by: Asad Khan | last post by:
Hi, I have Visual Studio 2002 Enterprise Architecture Edition. I was wondering if anyone has any information on how I can develop applications for .Net Compact Framework using this IDE. I've heard...
2
3562
by: paul | last post by:
I have developed an application for pocket pc that requires multiple forms to be open at any one time. The user is able to flick from one to the other, making changes to each as and when necessary...
4
2020
by: André Giesing | last post by:
Hello NG! I've got a short question: Is there a difference of the internal representation of a Hashtable between the Compact Framework and the normal Framework? I've got the suspicion,...
0
1538
by: Roland Rosier | last post by:
Hello, I am trying to understand Managed C++ and the .Net Framework, and as far as I can tell, you add a /CLR option to the compiler to make it generate MSIL from C++. However, I need to...
5
4230
by: brett | last post by:
When I do Console.Write("something here") or WriteLine() on the Compact Framework, nothing appears in the output window. I have also tried it on another developer's machine with the same results. ...
3
2613
by: Greg | last post by:
Hello all, I am looking to download an image from a website from within a compact framework pda app. I have tried everything I could find and thus I turn to you. Any help or suggestions would be...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.