473,671 Members | 2,384 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 2864
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
4964
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 Compact Framework-The .NET Compact Framework is in ROM in all new Pocket PC 2003 devices, and can be installed in RAM in Pocket PC 2000 and Pocket PC 2002 devices. The question is: how? Answers would be greatly appreciated
0
2599
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 PocketPC, works on the laptop with .NET Framework. I was hoping you could help me with answering some questions: 1. Does HTTPS work for the System.Net.WebRequest.Create (sURL), GetRequestStream, System.IO.StreamWriter library calls we are making...
2
2855
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 reinstalled it. I also installed all the QFEs. When I tried to reinstall the release Compact Framework, I get a message that it is already installed and the installation aborted.
1
2514
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 Visual Studio 2003 ships with the functionality for .Net Compact Framework development. But right now I have Visual Studio 2002. Is there anything I can do? (Other than the obvious upgrade to 2003). I've heard some beta version of .Net Compact...
2
3578
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 The application uses a stacking system to hold instances of the forms, and an array to hold "previous navigation" information (information on this method was found on "http://smartdevices.microsoftdev.com/Learn/Articles/505.aspx") The problem I have...
4
2025
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, because when I Serialize the same Object (with a Hashtable in it) on a Computer with the normal .NET Framework and on a mobile Device (which uses the Compact Framework) the byteStream is different!
0
1545
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 generate MSIL for use with the Compact Framework used on Windows CE and I cannot see any obvious way to make Visual Studio.Net C++ generate MSIL that uses the
5
4244
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. The Docs say this is supported in the Compact Framework. Any ideas? Thanks, Brett
3
2619
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 appreciated. Thank you.
0
8919
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8599
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6230
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4225
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2813
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 we have to send another system
2
2052
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.