本文整理汇总了C#中System.Windows.Forms.TextBox.FindForm方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.FindForm方法的具体用法?C# TextBox.FindForm怎么用?C# TextBox.FindForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.FindForm方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextBoxAppender
public TextBoxAppender(TextBox textBox)
{
var frm = textBox.FindForm();
if (frm == null)
return;
frm.FormClosing += delegate { Close(); };
_textBox = textBox;
Name = "TextBoxAppender";
}
示例2: CErrorTextBoxHandler
private CErrorTextBoxHandler(TextBox i_txtBox)
{
// VBConversions Note: Non-static class variable initialization is below. Class variables cannot be initially assigned non-static values in C#.
C_BACKCOLOR_ERROR = System.Drawing.Color.Pink;
m_txtBox = i_txtBox;
m_txtBox.Tag = this;
m_form = i_txtBox.FindForm();
addErrorMark();
try
{
m_txtBox.Focus();
m_txtBox.TextChanged += handle_changed;
m_txtBox.Leave += handle_leave;
}
catch (Exception)
{
m_form.KeyDown += keydown_in_form;
}
}
示例3: ValidateNoParameters
private bool ValidateNoParameters(TextBox textBoxEntry)
{
// pick out the <param> values in the server url string
string parameters = BlogProviderParameters.ExtractParameterList(textBoxEntry.Text.Trim());
// if there are values then tell the user they must fill them in
if (parameters.Length > 0)
{
DisplayMessage.Show(MessageId.ServerParameterNotSpecified, textBoxEntry.FindForm(), parameters.ToString());
textBoxEntry.Focus();
return false;
}
else
{
return true;
}
}
示例4: PickUpPoint
/// <summary>
/// �ڵ�ͼ��ʰȡ�㣬�Զ����textbox
/// </summary>
/// <params name="txtX">X����TextBox�ؼ�</params>
/// <params name="txtY">Y����TextBox�ؼ�</params>
public static void PickUpPoint(TextBox txtX, TextBox txtY)
{
if (txtX.FindForm().Owner != null && txtX.FindForm().Owner != g_pAxMapControl.FindForm())
txtX.FindForm().Owner.WindowState = FormWindowState.Minimized;
ICommand command = new GIS.SpecialGraphic.DrawPoint(txtX, txtY);
command.OnCreate(g_pMyMapCtrl);
if (command.Enabled)
g_pAxMapControl.CurrentTool = (ITool)command;
}
示例5: SetAllKeyBoardWithForm
public static void SetAllKeyBoardWithForm(TextBox txt, int keyboardType)
{
if (keyboardType == 7)
{
return;
}
Form frm=null;
if (keyboardType == 1)
{
if (allKeyBoardForm == null)
{
allKeyBoardForm = new VitualKeyboardForm();
}
frm = allKeyBoardForm;
allKeyBoardForm.InputTextBox = txt;
#if DEBUG
Console.WriteLine("SetAllKeyBoardWithForm开始显示键盘VitualKeyboardForm");
#endif
}
else
{
if (numKeyBoardForm == null)
{
numKeyBoardForm = new VitualNumKeyboardForm();
}
frm = numKeyBoardForm;
numKeyBoardForm.InputTextBox = txt;
#if DEBUG
Console.WriteLine("SetAllKeyBoardWithForm开始显示键盘numKeyBoardForm");
#endif
}
Point point = txt.Parent.PointToScreen(txt.Location);
#if DEBUG
Console.WriteLine("转化屏幕的坐标是:X=" + point.X.ToString() + "=Y=" + point.Y.ToString());
#endif
int height = txt.Parent.Parent.Height;
// allKeyBoard2.InputTextBox = txt;
#if DEBUG
Console.WriteLine("userinput下划线的坐标是:X=" + txt.Parent.Location.X.ToString() + "=Y=" + txt.Parent.Location.Y.ToString() + "userinput高度:" + height.ToString() + "键盘窗体高度:" + frm.Height.ToString() + "键盘窗体宽度:" + frm.Width.ToString());
#endif
frm.Hide();
#if DEBUG
Console.WriteLine("转化前键盘的坐标是:X=" + frm.Location.X.ToString() + "=Y=" + frm.Location.Y.ToString()+"-txt所在窗体的宽度为:"+txt.FindForm().Width.ToString());
#endif
int tmpx = point.X;
int SH = Screen.PrimaryScreen.Bounds.Height;
int SW = Screen.PrimaryScreen.Bounds.Width;
if (SW< tmpx + frm.Width)
{
tmpx =SW - frm.Width - 30;
}
// if (txt.FindForm().Width < tmpx + frm.Width)
// {
//tmpx = txt.FindForm().Width - frm.Width - 30;
// }
if (point.Y > frm.Height+14)
{
if (txt is HintTextBox)
{
frm.Location = new Point(tmpx - 14, point.Y - frm.Height - 15);
}
else
{
frm.Location = new Point(tmpx, point.Y - frm.Height);
}
}
else
{
if (txt is HintTextBox)
{
frm.Location = new Point(tmpx - 14, point.Y + height - 14 + 1);
}
else
{
frm.Location = new Point(tmpx, point.Y + height + 1);
}
}
frm.TabStop = false;
#if DEBUG
//allKeyBoardForm.BringToFront();
Console.WriteLine("转化后键盘的坐标是:X=" + frm.Location.X.ToString() + "=Y=" + frm.Location.Y.ToString());
#endif
// frm.ShowDialog();
// frm.Show();
frm.Visible = true;
}
示例6: SetAllKeyBoard2
public static void SetAllKeyBoard2(TextBox txt)
{
allKeyBoard.InputTextBox = txt;
Point point = txt.Parent.PointToScreen(txt.Location);
Form frm = allKeyBoard.FindForm();
if (frm == null)
{
// Console.WriteLine("");
txt.FindForm().Controls.Add(allKeyBoard);
}
else
{
frm.Controls.Remove(allKeyBoard);
txt.FindForm().Controls.Add(allKeyBoard);
}
if (point.Y > allKeyBoard.Height + txt.Height)
{
allKeyBoard.Location = new Point(point.X, point.Y - allKeyBoard.Height - txt.Height + 20);
}
else
{
allKeyBoard.Location = new Point(point.X, point.Y + txt.Height + 1);
}
allKeyBoard.Visible = true;
}
示例7: SetAllKeyBoard
public static void SetAllKeyBoard(TextBox txt)
{
allKeyBoard2.InputTextBox = txt;
Point point = txt.Parent.PointToScreen(txt.Location);
#if DEBUG
Console.WriteLine("转化屏幕的坐标是:X=" + point.X.ToString() + "=Y=" + point.Y.ToString());
#endif
Form frm = allKeyBoard2.FindForm();
if (frm == null)
{
txt.FindForm().Controls.Add(allKeyBoard2);
}
else
{
frm.Controls.Remove(allKeyBoard2);
txt.FindForm().Controls.Add(allKeyBoard2);
}
// allKeyBoard2.InputTextBox = txt;
#if DEBUG
Console.WriteLine("txt下划线的坐标是:X=" + txt.Location.X.ToString() + "=Y=" + txt.Location.Y.ToString() + "txt高度:" + txt.Height.ToString() + "键盘高度:" + allKeyBoard2.Height.ToString() + "键盘宽度:" + allKeyBoard2.Width.ToString());
Console.WriteLine("转化前键盘的坐标是:X=" + allKeyBoard2.Location.X.ToString() + "=Y=" + allKeyBoard2.Location.Y.ToString());
#endif
int tmpx = point.X-30;
if (txt.FindForm().Width < point.X + allKeyBoard2.Width)
{
tmpx=txt.FindForm().Width-allKeyBoard2.Width-30;
}
if (point.Y > allKeyBoard2.Height + txt.Height)
{
allKeyBoard2.Location = new Point(tmpx, point.Y - allKeyBoard2.Height - txt.Height + 20);
}
else
{
allKeyBoard2.Location = new Point(tmpx, point.Y + txt.Height + 1);
}
allKeyBoard2.TabStop = false;
allKeyBoard2.BringToFront();
#if DEBUG
Console.WriteLine("转化后键盘的坐标是:X=" + allKeyBoard2.Location.X.ToString() + "=Y=" + allKeyBoard2.Location.Y.ToString());
#endif
allKeyBoard2.Visible = true;
}
示例8: ShowInput
//private static
public static void ShowInput(TextBox txt)
{
//.ShowToTextBox(txt);
VitualKeyBoardPanel panel=new VitualKeyBoardPanel();
panel.InputTextBox = txt;
Form form = new Form();
// Form formBorder = new Form();
// formBorder.Paint += new PaintEventHandler(formBorder_Paint);
//form.FormBorderStyle = FormBorderStyle.FixedToolWindow;
form.FormBorderStyle = FormBorderStyle.None;
panel.Paint += new PaintEventHandler(formBorder_Paint);
form.Width = panel.Width;
form.Height = panel.Height;
panel.Dock = DockStyle.Fill;
form.Controls.Add(panel);
Point point=txt.FindForm().PointToScreen(txt.Location);
form.StartPosition = FormStartPosition.Manual;
if (point.Y > panel.Height+txt.Height)
{
form.Location = new Point(point.X, point.Y -panel.Height- txt.Height+20);
}
else
{
form.Location = new Point(point.X, point.Y + txt.Height+1);
}
//txt.Text = point.X.ToString() + "-" + point.Y.ToString()+"-"+txt.Height;
//form.StartPosition = FormStartPosition.CenterParent;
// form.Paint += new PaintEventHandler(form_Paint);
// MainForm.BackColor = Color.Blue;
form.ShowDialog();
}