當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.TextBoxBase類代碼示例

本文整理匯總了C#中System.Windows.Forms.TextBoxBase的典型用法代碼示例。如果您正苦於以下問題:C# TextBoxBase類的具體用法?C# TextBoxBase怎麽用?C# TextBoxBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TextBoxBase類屬於System.Windows.Forms命名空間,在下文中一共展示了TextBoxBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LogWriter

 public LogWriter(TextBoxBase textBox, string path, bool writeTimestamp, bool append, params TextWriter[] otherOutputs)
     : base(path, writeTimestamp, append, otherOutputs)
 {
     _textBox = textBox;
     _scrollTextBox = true;
     _textBox.MouseWheel += new MouseEventHandler(textBox_MouseWheel);
 }
開發者ID:ilMagnifico,項目名稱:asymmetric-threat-tracker,代碼行數:7,代碼來源:LogWriter.cs

示例2: TextNormalizer

		public TextNormalizer (TextBoxBase textboxbase) 
		{
			this.textboxbase = textboxbase;
			
			start_point = 0;
			end_point = Text.Length;
		}
開發者ID:mono,項目名稱:uia2atk,代碼行數:7,代碼來源:TextNormalizer.cs

示例3: SpellChecker

        public SpellChecker(TextBoxBase textbox, string localeId)
        {
            this.textbox = textbox;
            this.localeId = localeId;

            baseDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
        }
開發者ID:ADTC,項目名稱:VietOCR,代碼行數:7,代碼來源:SpellChecker.cs

示例4: AppendText

 public static void AppendText(TextBoxBase control, string text)
 {
     if (control.InvokeRequired)
         control.Invoke(new AppendTextDelegate(AppendText), control, text);
     else
         control.AppendText(text);
 }
開發者ID:greeduomacro,項目名稱:phoenix,代碼行數:7,代碼來源:Safe.cs

示例5: CharFromPos

        /// <summary>
        ///   Returns the index of the character under the specified 
        ///   point in the control, or the nearest character if there
        ///   is no character under the point.
        /// </summary>
        /// <param name = "textBox">The text box control to check.</param>
        /// <param name = "point">The point to find the character for, 
        ///   specified relative to the client area of the text box.</param>
        /// <returns></returns>
        internal static int CharFromPos(TextBoxBase textBox, Point point)
        {
            unchecked
            {
                // Convert the point into a DWord with horizontal position
                // in the loword and vertical position in the hiword:
                var xy = (point.X & 0xFFFF) + ((point.Y & 0xFFFF) << 16);
                // Get the position from the text box.
                var res =
                    NativeMethods.SendMessageInt(
                        textBox.Handle,
                        NativeMethods.EM_CHARFROMPOS,
                        IntPtr.Zero,
                        new IntPtr(xy)).ToInt32();

                // the Platform SDK appears to be incorrect on this matter.
                // the hiword is the line number and the loword is the index
                // of the character on this line
                var lineNumber = ((res & 0xFFFF) >> 16);
                var charIndex = (res & 0xFFFF);

                // Find the index of the first character on the line within
                // the control:
                var lineStartIndex =
                    NativeMethods.SendMessageInt(
                        textBox.Handle,
                        NativeMethods.EM_LINEINDEX,
                        new IntPtr(lineNumber),
                        IntPtr.Zero).ToInt32();
                // Return the combined index:
                return lineStartIndex + charIndex;
            }
        }
開發者ID:jystic,項目名稱:gitextensions,代碼行數:42,代碼來源:TextBoxHelper.cs

示例6: HotSpot

		public HotSpot(TextBoxBase control, int offset, int length)
		{
			if(control == null)
			{
				throw  new ArgumentNullException("control");
			}
			if(offset < 0)
			{
				throw  new ArgumentOutOfRangeException("offset", offset, "offset cannot be less than zero");
			}
			if (offset >= control.Text.Length)
			{
				throw new ArgumentOutOfRangeException("offset", offset, "offset must be shorter than text.");
			}
			if(length <= 0)
			{
				throw new ArgumentOutOfRangeException("length", offset, "length must be greater than zero");
			}
			if (offset + length > control.Text.Length)
			{
				throw new ArgumentOutOfRangeException("length", length, "length plus offset must be shorter than text.");
			}
			_control = control;
			_offset = offset;
			_text = _control.Text.Substring(_offset, length);
		}
開發者ID:jwickberg,項目名稱:libpalaso,代碼行數:26,代碼來源:HotSpot.cs

示例7: TextBoxWriter

        /// <summary>
        /// Creates a new instance of the <see cref="TextBoxWriter"/> class.
        /// </summary>
        /// <param name="b">The <see cref="TextBoxBase"/> that will be written to.</param>
        /// <exception cref="NullReferenceException">Thrown if the supplied TextBoxBase is null.</exception>
        public TextBoxWriter( TextBoxBase b )
        {
            if ( b == null )
                throw new NullReferenceException();

            textBox = b;
        }
開發者ID:modernist,項目名稱:CrawlWave,代碼行數:12,代碼來源:TextBoxWriter.cs

示例8: ShouldSelectToken

 private static bool ShouldSelectToken(Match match, TextBoxBase label)
 {
     var start = match.Index;
     var end = start + match.Length;
     var caret = label.SelectionStart;
     return caret >= start && caret <= end;
 }
開發者ID:JGTM2016,項目名稱:bdhero,代碼行數:7,代碼來源:TextBoxExtensions.cs

示例9: CustomPaintTextBox

        public CustomPaintTextBox(TextBoxBase clientTextBox, SpellChecker checker)
        {
            //Set up the CustomPaintTextBox
            this.clientTextBox = clientTextBox;
            this.mySpellChecker = checker;

            //Create a bitmap with the same dimensions as the textbox
            myBitmap = new Bitmap(clientTextBox.Width, clientTextBox.Height);

            //Create the graphics object from this bitmpa...this is where we will draw the lines to start with
            bufferGraphics = Graphics.FromImage(this.myBitmap);
            bufferGraphics.Clip = new Region(clientTextBox.ClientRectangle);

            //Get the graphics object for the textbox.  We use this to draw the bufferGraphics
            textBoxGraphics = Graphics.FromHwnd(clientTextBox.Handle);

            //Assign a handle for this class and set it to the handle for the textbox
            this.AssignHandle(clientTextBox.Handle);

            //We also need to make sure we update the handle if the handle for the textbox changes
            //This occurs if wordWrap is turned off for a RichTextBox
            clientTextBox.HandleCreated += TextBoxBase_HandleCreated;

            //We need to add a handler to change the clip rectangle if the textBox is resized
            clientTextBox.ClientSizeChanged += TextBoxBase_ClientSizeChanged;

            //this.disposedValue = false;
        }
開發者ID:ADTC,項目名稱:VietOCR,代碼行數:28,代碼來源:CustomPaintTextBox.cs

示例10: GetSpellCheck

        public bool GetSpellCheck(TextBoxBase extendee)
        {
            if(this.textBoxes.Contains(extendee))
                return (bool)this.textBoxes[extendee];

            return false;
        }
開發者ID:madhon,項目名稱:NetSpell,代碼行數:7,代碼來源:TextBoxExtender.cs

示例11: AddControl

 public void AddControl(TextBoxBase control)
 {
     control.KeyUp += new KeyEventHandler(control_KeyUp);
     control.MouseClick += new MouseEventHandler(control_MouseClick);
     control.GotFocus += new EventHandler(control_GotFocus);
     control.KeyDown += new KeyEventHandler(control_KeyDown);
 }
開發者ID:dmarijanovic,項目名稱:uber-tools,代碼行數:7,代碼來源:AutoComplete_OLD.cs

示例12: Editor

 public Editor(TextBoxBase tbb)
 {
     _TextBoxBase = tbb;
     _TextBoxBase.KeyDown += new KeyEventHandler(KeyDown);
     _TextBoxBase.KeyUp += new KeyEventHandler(KeyUp);
     _TextBoxBase.KeyPress += new KeyPressEventHandler(KeyPress);
 }
開發者ID:ashish-antil,項目名稱:Products,代碼行數:7,代碼來源:Editor.cs

示例13: AppendText

 public static void AppendText(TextBoxBase tb, string text)
 {
     if (tb == null) return;
     tb.SuspendLayout();
     tb.SelectionStart = tb.TextLength;
     tb.SelectedText = text;
     tb.ResumeLayout();
 }
開發者ID:manojdjoshi,項目名稱:simple-assembly-exploror,代碼行數:8,代碼來源:SimpleTextbox.cs

示例14: TextBoxTracer

 public TextBoxTracer(TextBoxBase t, StringCollection data)
 {
     this.txtLog = t;
     this.logData = data;
     writeAction = s => t.Invoke(new Action(() =>
     {
         t.Text += s;
     }));
 }
開發者ID:HungryBear,項目名稱:rayden,代碼行數:9,代碼來源:LogController.cs

示例15: Add

        public static void Add(TextBoxBase textBox, string message)
        {
            if (textBox.Text == "Log")
              {
            textBox.Text = string.Empty;
              }

              textBox.Text += DateTime.Now + OneSpace + Dash + OneSpace + message + Crlf;
        }
開發者ID:fredatgithub,項目名稱:GitAutoUpdate,代碼行數:9,代碼來源:Logger.cs


注:本文中的System.Windows.Forms.TextBoxBase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。