Webcontrols

  • Thread starter Mohamed Oubouchil
  • Start date
M

Mohamed Oubouchil

I'm trying to create a webcontrols, similar to a TextBox. I'm using
this function:

[DllImport("coredll.dll")]
private static extern IntPtr GetCapture();

public static IntPtr GetHWnd(Control ctrl)
{
IntPtr hOldWnd = GetCapture();
ctrl.Capture = true;
IntPtr hWnd = GetCapture();
ctrl.Capture = false;
SetCapture(hOldWnd);
this.Invalidate();
return hWnd;
}
I have use this code for windows forms and it work fine, but when i
hirite my controls from system.Web.UI.Webcontrols.testbox, it's giving
error
- "ctrl.Capture = true" not supporting by system.Web.UI.Webcontrols
- "Invalidate()" not supporting by system.Web.UI.Webcontrols
please can you help me to resolve these issues.

Thanks advanced for your help,

Best regards,

Mohamed Oubouchil
Mughamrat
 
D

Daniel Moth

Migrating code from winforms to webforms is not as simple as that. As you
found out the Windows.Forms.TextBox and the WebControls.TextBox have
different methods (hence your not supported errors). E.g. web controls do
not have windows handles.

You better place questions like that to the aspnet.webcontrols newsgroup..
Here we deal with the Compact Framework which is about running thick clients
on the device itself.

Cheers
Daniel
 
M

Mohamed Oubouchil

Thanks Daniel,

I would be grateful if you could explain me how i can right aligmnet my
text box into ASP.net, thanks advanced for your help

Mohamed Oubouchil
 

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