c# - Textbox not clickable but editable -


I have a small form with 10 text boxes, I have set them in the correct tab order. I want them on my tab service I was wondering if there is a way to set the text box so that they can be selected for editing until they are tabbed. That is ... I do not want the end user to edit the text box to click on them, I just want to make them editable through tabu.

this should do the trick

  public partial category poor text box: Text Box {Safe Override Zero WndProc (Ref: Message Message) {if (m.msg == (Int) WM.LBUTTONDOWN) {Return; // mount down events} base.WndProc (ref m); }}   

Window message enum can be found.


How to do this without anherizing: text box :
  class EatMouseDown: netwindows {safe override zero WndProc (ref message message) {if (m.msg == (int) WM.LBUTTONDOWN) {return; } Base.WandProc (Ref M); }} Safe Override Zero Onload (EventEurge E) {base.OnLoad (e);   


How to do this without any part:

left a clean part, whatever is important, this can be a buggy but it works Recommended method is to use heritage. The necessary methods were removed from the net fw src.

  Class EatMouseDown {Public Representative IntPtr WndProc (IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); #region External methods ... [DllImport ("user32.dll", Charset = CharSet.Auto)] Public Static Extern IntPtr SetWindowLong (HandleRef hWnd, int nIndex, WndProc wndproc); [DllImport ("user32.dll", charset = charset.auto)] Public static extern IntPtr SetWindowLongPtr (HandleRef hWnd, int nIndex, WndProc wndproc); [DllImport ("user32.dll", Charset = Charset.auto)] Public Static Extern IntPtr GetWindowLong (HandleRef hWnd, int nIndex); [DllImport ("user32.dll", Charset = Charset.auto)] Public Static Extern IntPtr GetWindowLongPtr (HandleRef hWnd, int nIndex); [DllImport ("user32.dll", chartset = charset.auto)] Public static extern IntPtr defWindowProc (IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); [DllImport ("user32.dll", Charset = Charset.auto)] Public Static Extern IntPtr Call Window Pro (Intepetrate wndProc, IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); #Orthrion Pvt. Const GWLP_WNDPROC = -4; Private interrupt handle; Private Intupet Original WPPRC; Private intake current Wendoprock; Public stable interpitter set window long helper (handlerfwd, int new indices, wddpccdpcc) {return intrap size == 4? Setwondo Long (HWND, NIDX, WDDPCC): Setwondo Longprint (HWND, NIDX, WDPRC); } Public Static Interrupt Gatevondol Long Heller (Handler HWND, Int New Indexes) {Return Intraprase Size == 4? GetWindowLong (HWND, NIDX): Gatevondo Longprint (HWND, NIDX); } Internal zero subclassHandle (IntPtr handle) {this.handle = handle; This.originalWndProc = GetWindowLongHelper (new handler (this, handle), GWLP_WNDPRC); Set Window Long Helper (new handler (this, handle), GWLP_WDPRC, new WDPRC (this. Callback)); This.currentWndProc = GetWindowLongHelper (new handler (this, handle), GWLP_WNDPRC); } Private ITPT callback (Interrupted HWD, ITM, ITPTR WyRum, Interpet Lipermalm) {var M = Message. Create (HWD, MMS, Vaparam, Liparam); If (m.msg == (int) WM.LBUTTONDOWN) {return IntPtr.Zero; } Return Callwandows PRC (original WPPRC, HWD, MMS, PAPARAM, LIPARAM); }} Safe Override Zero Onload (EventEurge E) {base.OnLoad (e); New IntamusDown () Sub-sectionhandle (text box 1.handel); // sub-margin one handle}    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -