Groups | Blog | Home
all groups > c# > june 2004 >

c# : Textbox ID in C#


wallacewhlee NO[at]SPAM yahoo.com.hk
6/29/2004 11:04:28 PM
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.
Shakir Hussain
6/30/2004 1:29:52 AM
Wallace,

You have to use handle property of the Control.

IntPtr ID = TextBox.Handle;

Shak
(Houston)


[quoted text, click to view]

AddThis Social Bookmark Button