コード例 #1
0
ファイル: MessageForm.cs プロジェクト: sergeystoyan/CliverBot
 private void Message_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     var rtb = (RichTextBox)sender;
     Size s = this.Size;
     {
         int h = e.NewRectangle.Height - rtb.Height;
         if (h > 0)
         {
             int h2 = Screen.PrimaryScreen.WorkingArea.Height * 3 / 4 - this.Height;
             s.Height += h2 < h ? h2 : h;
         }
     }
     {
         int w = e.NewRectangle.Width - rtb.Width;
         if (w > 0)
         {
             int w2 = Screen.PrimaryScreen.WorkingArea.Width * 3 / 4 - this.Width;
             s.Width += w2 < w ? w2 : w;
         }
     }
     {
         if (s.Height > s.Width)
         {
             s.Height -= 100;
             s.Width += 100;
         }
     }
     this.Size = s;
 }
コード例 #2
0
 private void Content_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     Content.Height = e.NewRectangle.Height;
     Height = Content.Height + 18;
     this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
     this.Top = Screen.PrimaryScreen.WorkingArea.Height - this.Height;
 }
コード例 #3
0
 protected override void OnContentsResized(ContentsResizedEventArgs e)
 {
     HeaderPanel headerPanel = Parent as HeaderPanel;
     
     Debug.Assert(headerPanel != null,
         "HeaderLabel should be placed inside of a HeaderPanel.");
     headerPanel.RequestNewHeight(this, e.NewRectangle.Height);
     base.OnContentsResized(e);
 }
コード例 #4
0
ファイル: Mountain.cs プロジェクト: Dragonfoot/mountain
 private void roomDescriptionRichTextBox_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     roomDescriptionRichTextBox.Height = e.NewRectangle.Height + 5;
 }
コード例 #5
0
 private void ParentContentsResized(object sender, ContentsResizedEventArgs e)
 {
     pContentRectangle = e.NewRectangle;
     Refresh();
     Invalidate();
 }
コード例 #6
0
ファイル: AutosizeLabel.cs プロジェクト: IntegralLee/fomm
 /// <summary>
 ///   Resizes the label as the content size changes.
 /// </summary>
 /// <param name="e">A <see cref="ContentsResizedEventArgs" /> describing the event arguments.</param>
 protected override void OnContentsResized(ContentsResizedEventArgs e)
 {
   Height = e.NewRectangle.Height + 5;
   base.OnContentsResized(e);
 }
コード例 #7
0
ファイル: ODtextBox.cs プロジェクト: mnisl/OD
		///<summary>When the contents of the text box is resized, e.g. when word wrap creates a new line, clear red wavy lines so they don't shift down.</summary>
		private void ODtextBox_ContentsResized(object sender,ContentsResizedEventArgs e) {
			try {
				if(DesignMode || !this.spellCheckIsEnabled || !PrefC.GetBool(PrefName.SpellCheckIsEnabled)) {//if spell check disabled, return
					return;
				}
			}
			catch {
				//This can only happen if designing and DesignMode is false for some reason.  Has happened when this control is two levels deep.
				//The exception happens in PrefC.GetBool() because there is no database connection in design time.
				return;
			}
			Point textEndPointCur=this.GetPositionFromCharIndex(Text.Length-1);
			if(textEndPoint==new Point(0,0)) {
				textEndPoint=textEndPointCur;
				return;
			}
			if(textEndPointCur.Y!=textEndPoint.Y) {//textEndPoint cannot be null, if not set it defaults to 0,0
				ClearWavyLines();
			}
			textEndPoint=textEndPointCur;
		}
コード例 #8
0
 private void RichTextBox_QuestionCase_Manual_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     ((RichTextBox)sender).Height = e.NewRectangle.Height + 5;
 }
コード例 #9
0
		/// <summary>
		/// Handles the <see cref="RichTextBox.ContentsResized"/> event of the rich text label.
		/// </summary>
		/// <remarks>
		/// Resizes the label as the content size changes.
		/// </remarks>
		/// <param name="sender">The object that raised the event.</param>
		/// <param name="e">A <see cref="ContentsResizedEventArgs"/> describing the event arguments.</param>
		private void Label_ContentsResized(object sender, ContentsResizedEventArgs e)
		{
			if (AllowSelection || (m_sbrScrollBars == RichTextBoxScrollBars.None))
				Height = e.NewRectangle.Height + 5;
			
		}
コード例 #10
0
ファイル: TaskDetail.cs プロジェクト: Alprog/CornTracker
 private void History_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     Rectangle r = e.NewRectangle;
     //MessageBox.Show(r.Width + " " + r.Height);
     
 }
コード例 #11
0
ファイル: RichTextBox.cs プロジェクト: KonajuGames/SharpLang
		protected virtual void OnContentsResized (ContentsResizedEventArgs e)
		{
			ContentsResizedEventHandler eh = (ContentsResizedEventHandler)(Events [ContentsResizedEvent]);
			if (eh != null)
				eh (this, e);
		}
コード例 #12
0
ファイル: RichTextBox.cs プロジェクト: modulexcite/NTranslate
        protected override void OnContentsResized(ContentsResizedEventArgs e)
        {
            base.OnContentsResized(e);

            if (SizeToContent)
            {
                int height =
                    e.NewRectangle.Height +
                    (Height - ClientSize.Height) +
                    1;

                Height = height;
            }
        }
コード例 #13
0
		void TextBox_ContentsResized(object sender, ContentsResizedEventArgs e)
		{
            int increase = e.NewRectangle.Width - TextBox.ClientSize.Width;
            if (increase > 0)
            {
                TextBox.Width += increase;
                this.Width += increase;
            }
		}
コード例 #14
0
 private void lblCompatibilityNote_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
   RichTextBox richTextBox = sender as RichTextBox;
   if (richTextBox == null)
     return;
   //richTextBox.SuspendLayout();
   int newHeight = e.NewRectangle.Height + 5;
   pnlTop.Height = richTextBox.Top + newHeight;
   richTextBox.Height = newHeight;
   
   //richTextBox.ResumeLayout();
   int deltaHeight = richTextBox.Height - newHeight;
   Height += deltaHeight;
 }
コード例 #15
0
ファイル: ShowChat.cs プロジェクト: kurakiyuka/KChatForC
 private void rtbContent_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     this.Height = e.NewRectangle.Height;
 }
コード例 #16
0
 protected virtual void OnContentsResized(ContentsResizedEventArgs e)
 {
     ContentsResizedEventHandler handler = (ContentsResizedEventHandler) base.Events[EVENT_REQUESTRESIZE];
     if (handler != null)
     {
         handler(this, e);
     }
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// contentsresizedeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this ContentsResizedEventHandler contentsresizedeventhandler, Object sender, ContentsResizedEventArgs e, AsyncCallback callback)
        {
            if(contentsresizedeventhandler == null) throw new ArgumentNullException("contentsresizedeventhandler");

            return contentsresizedeventhandler.BeginInvoke(sender, e, callback, null);
        }
コード例 #18
0
ファイル: ToolTipForm.cs プロジェクト: sonygod/dotahit
 private void contentRTB_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     contentRTB.Size = e.NewRectangle.Size;
 }
コード例 #19
0
ファイル: ItemToolTipForm.cs プロジェクト: sonygod/dotahit
 private void contentRTB_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     (sender as RichTextBox).Size = e.NewRectangle.Size;
 }
コード例 #20
0
 private void richTextBoxContent_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     ((RichTextBox)sender).Height = e.NewRectangle.Height + 5;
 }
コード例 #21
0
        /// <summary>
        /// Handles the ContentsResized event of the MLifterTextBox control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.ContentsResizedEventArgs"/> instance containing the event data.</param>
        /// <remarks>Documented by Dev03, 2009-04-30</remarks>
        void MLifterTextBox_ContentsResized(object sender, ContentsResizedEventArgs e)
        {
            if (!Visible) return;

            if (Height < e.NewRectangle.Height)
            {
                Height = e.NewRectangle.Height + 10;
            }
            if (Height > minHeigth)
            {
                Height = e.NewRectangle.Height + 10;
            }
        }
コード例 #22
0
 //搜索结果文本框大小随内容变化而变化
 void roRTB_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     RichTextBox rtb = (RichTextBox)sender;
     rtb.Height = e.NewRectangle.Height + 10;
 }
コード例 #23
0
	protected virtual void OnContentsResized(ContentsResizedEventArgs e)
	{
		if (ContentsResized != null)
		{
			ContentsResized(this, e);
		}
	}
 protected override void OnContentsResized(ContentsResizedEventArgs e)
 {
     this._contentsResizedRaised = true;
     this.ResizeToContent();
     base.OnContentsResized(e);
 }
コード例 #25
0
			/// <summary>
			/// Resizes the label as the content size changes.
			/// </summary>
			/// <param name="e">A <see cref="ContentsResizedEventArgs"/> describing the event arguments.</param>
			protected override void OnContentsResized(ContentsResizedEventArgs e)
			{
				if (!AllowSelection)
					Height = e.NewRectangle.Height + 5;
				//we need to call this AFTER we set our height, as the label may wish to override us
				base.OnContentsResized(e);
			}
コード例 #26
0
 private void Message_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     var rtb = (RichTextBox)sender;
     {
         int h = e.NewRectangle.Height - rtb.Height;
         if (h > 0)
         {
             if (Screen.PrimaryScreen.WorkingArea.Height * 3 / 4 < this.Height + h)
                 h = Screen.PrimaryScreen.WorkingArea.Height * 3 / 4 - this.Height;
             this.Height += h;
         }
     }
     {
         int w = e.NewRectangle.Width - rtb.Width;
         if (w > 0)
         {
             if (Screen.PrimaryScreen.WorkingArea.Width * 3 / 4 < this.Width + w)
                 w = Screen.PrimaryScreen.WorkingArea.Width * 3 / 4 - this.Width;
             this.Width += w;
         }
     }
 }
コード例 #27
0
 void richTextBox1_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
 }
コード例 #28
0
 private void OnParentContentsResized(object sender, ContentsResizedEventArgs e)
 {
   Invalidate();
 }
コード例 #29
0
ファイル: CommentBlob.cs プロジェクト: Alprog/CornTracker
 private void rtfEditor_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     this.Height = (this.Height - rtfEditor.Size.Height) + e.NewRectangle.Height;
 }
コード例 #30
0
ファイル: Test.cs プロジェクト: tektak-abhisheksth/Web-API
 private void richTextBox_ContentsResized(object sender, ContentsResizedEventArgs e)
 {
     var richTextBox = (RichTextBox)sender;
     //richTextBox.Width = e.NewRectangle.Width;
     richTextBox.Height = e.NewRectangle.Height + 20;
 }