Textbox ID in C#

  • Thread starter Thread starter Wallace Lee
  • Start date Start date
W

Wallace Lee

I've a vendor provided executable that runs under WinCE .NET 4.2 and
requires two input parameters:
1. window handle of a dialog
2. ID of a textbox

The program will perform a barcode scanning and send the result to the
specified textbox. The program works fine in eVC++ 4.0 with the
following function call:

CString arg;
arg.Format(L"ScanToWindow H:%d ID:%d", GetSafeHwnd(), IDC_TEST);
CreateProcess(TEXT("\\windows\\Barcode.exe"),
arg,
NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL);

However, I need to develop an application in C# with compact
framework. I can find a routine to return the handle of the form:

[DllImport("CoreDll.dll")]
extern public static IntPtr GetCapture();

How about the corresponding textbox ID in C#? In eVC++, each textbox
is defined with an ID in a header file. Is there a counterpart in C#
textbox? I searched all the properties but no such decimal ID defined
in C#. Any idea?

Thanks for your help in advance.
Wallace
 
Wallace,

You have to use handle property of the Control.

IntPtr ID = TextBox.Handle;

Shak
(Houston)
 

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

Back
Top