private void C2iTextBox_MouseClick(object sender, MouseEventArgs e) { Point pt = new Point(e.X, e.Y); if (LockEdition && m_rectImage.Contains(pt)) { CFormZoomTextFloat.Show(Text, Width, LockEdition, BackColor); } }
public static string Show(string strText, int nWidth, bool bLockEdition, Color backColor) { CFormZoomTextFloat form = new CFormZoomTextFloat(); Graphics g = form.CreateGraphics(); SizeF sz = g.MeasureString(strText, form.Font, nWidth - 5); form.Size = new Size(Math.Max(nWidth, 50), Math.Max((int)sz.Height + 10, 21)); form.m_txtBox.Text = strText; form.m_txtBox.BackColor = backColor; form.m_txtBox.SelectionLength = 0; form.m_txtBox.SelectionStart = 0; form.m_bLockEdition = bLockEdition; form.Show(); return(form.m_txtBox.Text); }