473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can I mimic a btn_Click()?

Hi,

I have an application at work that I've inherited from a former employee.
This app runs on a Windows CE .NET environment on an LCD screen but I don't
think that this is the issue. The app has several buttons on the screen that
are clickable and have event handlers. These work fine. What I did was set
up a UDP link from a PC to the CE device and I want to send commands from my
PC instead of clicking the button on the device. This doesn't work very
well. It works if the action does not affect the display such as testing
LEDs on the device. If I have operations that remove buttons from the screen
and make others appear, the buttons appear to be dead. For example my form
gave me this event hander for the button which works well.

this.m_oCalibrateLCDBtn.Click += new
System.EventHandler(this.CalibrateLCD_Click);

When I receive the remote command from my PC I try to do a similar thing
which isn't working.

CalibrateLCD_Click(this.m_oCalibrateLCDBtn, dummyEventArgs);

I must be missing something from the form that the event handler has but I
don't know what it is. Some other points are: Other remote UDP command are
OK as long as the display is not affected. Once I'm in the
CalibrateLCD_Click() event handler my sender and "this" look OK in my
"Autos" window in both cases. My EventArgs is empty which is why I was able
to create a dummy. However once I start some operations that affect the
display (removing buttons such as setting enabled and visible to false) my
sender and my "this" get clobbered in my "Autos" window. It says "undefined
value". If I try to debug this with breakpoints things get even more messed
up. I had better luck with MessageBox(es) to debug but still am not having
any luck.

If anyone has any ideas on this I would appreciate advice. As I said I don't
I'm mimicking the Event Handler properly. Maybe I'm not supposed to do this
at all.

Rick
Nov 16 '05 #1
1 1248
Rick,

try: CalibrateLCD.PerformClick()

i.e. btnName.PerformClick()

A handy method I just discovered this week.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim | last post by:
I was wondering if there was a way I could write a script to change my user profile/info on a site using an html form inside a .php page without having to log in and do it all manually. I can...
9
by: Martin Foster | last post by:
Hi. I would like to be able to mimic the unix tool 'uniq' within a Perl script. I have a file with entries that look like this 4 10 21 37 58 83 111 145 184 226...
2
by: Andrew Poulos | last post by:
I'm trying to mimic IE's onreadystatechange in MZ. Specifically I'm looking at returning a value of "loading" to a frameset when a page is loading within one of the frameset's frames. Does anyone...
4
by: He Shiming | last post by:
Hi, I'm wondering how can I use <DIV> to mimic a <TABLE>. In a bare <TABLE> without a width attribute, the width of the table get dynamically expanded according to the content. However, <DIV>...
1
by: Todd | last post by:
I am trying to mimic the html anchor tag. I have created a class; Public Class anchor <XmlAttributeAttribute()> _ Public href As String Public title As String End Class and get the...
2
by: Ronny Sigo | last post by:
Hello all, I am making a database for my employer to be able to put in an archive of all letters recieved. The letters are scanned and stored in a certain directory as *.jpg, or *.pdf. What I...
3
by: Dave | last post by:
Hi, I have a C# program that is parsing an XML file and loading a database table. Some of the elements may be missing but I want to continue with loading the data anyway because they may not...
0
by: Patrice Nogueira | last post by:
Hi, When I press ENTER in my page, i want to launch the server function of my validation button (btn_click) ? It's possible ? Have you an idea to help me ? Thanks for you help...
2
by: Ron | last post by:
Hello, I have a button click event that opens two forms from a main form which has a timer on it. After the two forms get opened, I perform some procedures with them then close these two forms...
0
by: Chad Gerber | last post by:
I have created a form to collect comments from our customers. When I use the page as a standalon page the form works like a charm. As soon as I put a MasterPage into the mix the Btn_Click event...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.