How can i uniquely identify a Control ? (No control.name property?)

S

Sai

Hi all,

I am trying to write a desktop app which when given a DLL full of forms for
compact framework will look at each form and control through reflection and
auto-generate some code. However, I need to uniquely identify each control
when I use the auto-generated code on the pocket pc and I cannot tie the
code back to the control because the control.name property is not available.
How can i uniquely identify a control at runtime on the pocket pc without
using the control.name property ?

Thanks

Sai
 
J

Joe Keller

I had the same issue - only solution I could find was to inherit from the
control and add a property to denote a unique identifier for the control
(e.g. Tag, ControlName, etc.).

Joe
 
A

Andrew Martin

Sai said:
Hi all,

I am trying to write a desktop app which when given a DLL full of forms for
compact framework will look at each form and control through reflection and
auto-generate some code. However, I need to uniquely identify each control
when I use the auto-generated code on the pocket pc and I cannot tie the
code back to the control because the control.name property is not available.
How can i uniquely identify a control at runtime on the pocket pc without
using the control.name property ?

Thanks

Sai

We do something similar:

We can "identify" a control by its size(x,y) and location(x,y) and the
size and location of its parent control.

This only poses a problem if we have two controls that have identical
size and location properties on the same parent (happens for us in the
case of a couple detail panels on one of our forms). We just bump the
size one extra pizel to handle the problem.

-a
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top