本文整理汇总了C#中System.Windows.Forms.TextBox.Show方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.Show方法的具体用法?C# TextBox.Show怎么用?C# TextBox.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Login
public Login()
{
InitializeComponent();
textUsuario.Text = "admin";//Nombre de usuario administrador prederteminado
textClave.Text = "12345";//Claver de usuario administrador prederteminado
TextBox asd = new TextBox();
asd.Show();
}
示例2: NewMapDlg
public NewMapDlg()
: base()
{
FormBorderStyle = FormBorderStyle.FixedDialog;
Label t = new Label();
t.Text = "Width";
t.Location = new Point(10, 10);
t.Show();
Label u = new Label();
u.Text = "Height";
u.Location = new Point(t.Left, t.Bottom + 5);
u.Show();
widthbox = new TextBox();
widthbox.Location = new Point(t.Right + 5, 10);
widthbox.Show();
heightbox = new TextBox();
heightbox.Location = new Point(widthbox.Left, widthbox.Bottom + 5);
heightbox.Show();
Button okbutton = new Button();
okbutton.Text = "OK";
okbutton.DialogResult = DialogResult.OK;
okbutton.Location = new Point(t.Left, u.Bottom + 5);
okbutton.Show();
Button cancelbutton = new Button();
cancelbutton.Text = "Cancel";
cancelbutton.DialogResult = DialogResult.Cancel;
cancelbutton.Location = new Point(okbutton.Right + 5, okbutton.Top);
cancelbutton.Show();
Controls.Add(t);
Controls.Add(u);
Controls.Add(widthbox);
Controls.Add(heightbox);
Controls.Add(okbutton);
Controls.Add(cancelbutton);
AcceptButton = okbutton;
CancelButton = cancelbutton;
Width = heightbox.Right + 35;
Height = okbutton.Bottom + 35;
}
示例3: createStackDisplay
private void createStackDisplay()
{
TextBox box;
for (int i = 0; i < PIC.Data.OperationStack.STACK_SIZE; i++)
{
box = new TextBox();
box.SetBounds(5 + STACK_X_OFFSET, stackIndex0Label.Bounds.Y - TEXT_BOX_Y_OFFSET + i * 20, 25, 25);
box.Parent = this;
box.ReadOnly = true;
box.Show();
stackBoxes[i] = box;
}
updateStackDisplay();
//throw new NotImplementedException();
}
示例4: StartEdit
public void StartEdit(BaseElement el, TextBox textBox)
{
if (!(el is ILabelElement)) return;
if (((ILabelElement) el).Label.ReadOnly) return;
this.siteLabelElement = el;
this.labelElement = ((ILabelElement) siteLabelElement).Label;
this.labelTextBox = textBox;
if (siteLabelElement is BaseLinkElement)
this.direction = LabelEditDirection.Both;
else
this.direction = LabelEditDirection.UpDown;
EditLabelAction.SetTextBoxLocation(siteLabelElement, labelTextBox);
labelTextBox.AutoSize = true;
labelTextBox.Show();
labelTextBox.Text = labelElement.Text;
labelTextBox.Font = labelElement.Font;
labelTextBox.WordWrap = labelElement.Wrap;
labelElement.Invalidate();
switch(labelElement.Alignment)
{
case StringAlignment.Near:
labelTextBox.TextAlign = HorizontalAlignment.Left;
break;
case StringAlignment.Center:
labelTextBox.TextAlign = HorizontalAlignment.Center;
break;
case StringAlignment.Far:
labelTextBox.TextAlign = HorizontalAlignment.Right;
break;
}
labelTextBox.KeyPress += new KeyPressEventHandler(labelTextBox_KeyPress);
labelTextBox.Focus();
center.X = textBox.Location.X + (textBox.Size.Width / 2);
center.Y = textBox.Location.Y + (textBox.Size.Height / 2);
}
示例5: AddWord
public DialogResult AddWord()
{
Form wordForm = new Form();
wordForm.StartPosition = FormStartPosition.CenterScreen;
wordForm.FormBorderStyle = FormBorderStyle.Fixed3D;
wordForm.Size = new Size(250, 180);
wordForm.MinimizeBox = false;
wordForm.MaximizeBox = false;
wordForm.Text = "Новое слово";
Label wordLabel = new Label();
wordLabel.Location = new Point(10, 10);
wordLabel.AutoSize = false;
wordLabel.Size = new Size(230, 25);
wordLabel.Font = new Font("Times New Roman", 12, FontStyle.Bold);
wordLabel.Text = "Слово: ";
Label translateLabel = new Label();
translateLabel.Location = new Point(10, 60);
translateLabel.AutoSize = false;
translateLabel.Size = new Size(230, 25);
translateLabel.Font = new Font("Times New Roman", 12, FontStyle.Bold);
translateLabel.Text = "Перевод: ";
wordTextBox = new TextBox();
wordTextBox.Location = new Point(10, 35);
wordTextBox.Size = new Size(215, 25);
wordTextBox.Text = null;
translateTextBox = new TextBox();
translateTextBox.Location = new Point(10, 85);
translateTextBox.Size = new Size(215, 25);
translateTextBox.Text = null;
Button okButton = new Button();
okButton.Location = new Point(80, 115);
okButton.Size = new Size(70, 25);
okButton.DialogResult = DialogResult.OK;
okButton.Text = "OK";
Button cancelButton = new Button();
cancelButton.Location = new Point(155, 115);
cancelButton.Size = new Size(70, 25);
cancelButton.DialogResult = DialogResult.Cancel;
cancelButton.Text = "Cancel";
wordForm.Controls.Add(wordLabel);
wordForm.Controls.Add(translateLabel);
wordForm.Controls.Add(wordTextBox);
wordForm.Controls.Add(translateTextBox);
wordForm.Controls.Add(okButton);
wordForm.Controls.Add(cancelButton);
wordLabel.Show();
translateLabel.Show();
wordTextBox.Show();
translateTextBox.Show();
okButton.Show();
cancelButton.Show();
wordForm.ShowDialog();
return wordForm.DialogResult;
}
示例6: LoadSearchConfig
public void LoadSearchConfig(String EditConfigFile)
{
this.ConfigFile = EditConfigFile;
if (!File.Exists(this.ConfigFile))
return;
using (StreamReader sr = new StreamReader(this.ConfigFile))
{
String line;
int cLine = 0;
// Read and display lines from the file until the end of
// the file is reached.
while ((line = sr.ReadLine()) != null)
{
cLine++;
if ((cLine == 1) && (line != "editor.config.begin"))
return; /* invalid or corrupt config file */
string[] cfgLine = line.Split('^');
if (cfgLine[0] == "set.editor.title")
{
this.EditorTitle = cfgLine[1];
}
//configure.editor.window^636^458
if (cfgLine[0] == "configure.editor.window")
{
this.EditorWidth = int.Parse(cfgLine[1]);
this.EditorHeight = int.Parse(cfgLine[2]);
}
if (cfgLine[0] == "add.tab")
{
// add.tab^TabTitle^canselect yes or no
//cfgLine[1];
TabPage tPage = new TabPage(cfgLine[1]);
this.EditorTabs.Add(cfgLine[1], tPage);
}
if (cfgLine[0] == "add.button")
{
//# add.button^id^tabpage^width^height^top^left^value^function
//# function can be - savetodb , or closeeditor
//add.button^close^General^25^20^100^100^Close^closeeditor
TabPage tPage = (TabPage)this.EditorTabs[cfgLine[2]];
if (tPage == null)
return;
Button cmdButton = new Button();
cmdButton.Width = int.Parse(cfgLine[3]);
cmdButton.Height = int.Parse(cfgLine[4]);
cmdButton.Name = cfgLine[1];
tPage.Controls.Add(cmdButton);
cmdButton.Top = int.Parse(cfgLine[5]);
cmdButton.Left = int.Parse(cfgLine[6]);
cmdButton.Text = cfgLine[7];
cmdButton.Tag = cfgLine[8];
cmdButton.Show();
cmdButton.Click += new EventHandler(cmdButton_Click);
}
if (cfgLine[0] == "add.label")
{
// add.label^id^tabpage^width^height^top^left^value
TabPage tPage = (TabPage)this.EditorTabs[cfgLine[2]];
if (tPage == null)
return;
Label lblNew = new Label();
lblNew.Width = int.Parse(cfgLine[3]);
lblNew.Height = int.Parse(cfgLine[4]);
lblNew.Name = cfgLine[1];
tPage.Controls.Add(lblNew);
lblNew.Top = int.Parse(cfgLine[5]);
lblNew.Left = int.Parse(cfgLine[6]);
lblNew.Text = cfgLine[7];
lblNew.Show();
}
if (cfgLine[0] == "add.input.control")
//.........这里部分代码省略.........
示例7: HideLinkShowText
void HideLinkShowText(LinkLabel link, TextBox text, TimeSpan length)
{
text.Text = App.TimeToStringHHMM(length);
text.SelectAll();
text.Show();
text.Focus();
link.Hide();
}
示例8: lagreagar_Click
private void lagreagar_Click(object sender, EventArgs e)
{
Label Telefono = new Label();
TextBox tTelefono = new TextBox();
Telefono.Text = this.lTelefono.Text;
Telefono.Size = this.lTelefono.Size;
Telefono.Location = new Point(this.lTelefono.Location.X,
this.lista.Last<TextBox>().Location.Y + 50);
tTelefono.Size = this.lTelefono.Size;
tTelefono.Location = new Point(this.lTelefono.Location.X,
this.lista.Last<TextBox>().Location.Y + 50);
tTelefono.Show();
Telefono.Show();
lista.Add(tTelefono);
tTelefono.KeyPress += textBox5_KeyPress;
tTelefono.MaxLength = 10;
panel2.Controls.Add(tTelefono);
panel2.Controls.Add(Telefono);
}
示例9: lagreagar_Click_1
private void lagreagar_Click_1(object sender, EventArgs e)
{
Label Telefono = new Label();
TextBox tTelefono = new TextBox();
Telefono.Text = this.lteléfono.Text;
Telefono.Size = this.lteléfono.Size;
Telefono.Location = new Point(this.lteléfono.Location.X,
this.lista.Last<TextBox>().Location.Y + 50);
tTelefono.Size = this.lTelefono.Size;
tTelefono.Location = new Point(this.lTelefono.Location.X,
this.lista.Last<TextBox>().Location.Y + 50);
Telefono.Show();
tTelefono.Show();
lista.Add(tTelefono);
labelList.Add(Telefono);
tTelefono.KeyPress += textBox5_KeyPress;
tTelefono.KeyPress += lTelefono_TextChanged;
tTelefono.MaxLength = 10;
panel2.Controls.Add(tTelefono);
panel2.Controls.Add(Telefono);
bloquear_Boton();
bQuitar.Enabled = true;
}
示例10: bagregar_Click
private void bagregar_Click(object sender, EventArgs e)
{
Label Telefono = new Label();
TextBox tTelefono = new TextBox();
Telefono.Text = this.lTelefono.Text;
Telefono.Size = this.lTelefono.Size;
Telefono.Location = new Point(this.lTelefono.Location.X,
this.lista.Last<TextBox>().Location.Y + 50);
tTelefono.Size = this.textTelefono.Size;
tTelefono.Location = new Point(this.textTelefono.Location.X,
this.lista.Last<TextBox>().Location.Y + 50);
tTelefono.Show();
Telefono.Show();
lista.Add(tTelefono);
labelList.Add(Telefono);
tTelefono.KeyPress += textBox4_KeyPress;
tTelefono.TextChanged += textTelefono_TextChanged;
tTelefono.MaxLength = 10;
contenedorARepetir.Controls.Add(Telefono);
contenedorARepetir.Controls.Add(tTelefono);
BloquearBoton();
bQuitar.Enabled = true;
}
示例11: logButton_Click
private void logButton_Click(object sender, EventArgs e)
{
if (splitContainer2.Panel1.Controls.Count > 0 && splitContainer2.Panel1.Controls[0] is TextBox)
{
ClearScreen();
}
else
{
View.DisposeAndClearPanel(splitContainer2.Panel1);
TextBox box = new TextBox()
{
Multiline = true,
Left = 0,
Top = 0,
Size = splitContainer2.Panel1.Size,
ScrollBars = ScrollBars.Vertical
};
splitContainer2.Panel1.Controls.Add(box);
box.Show();
box.AppendText(logData.ToString());
}
}
示例12: pnlGridDraw_Paint
private void pnlGridDraw_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
pnlGridDraw.AutoSize = true;
pnlGridDraw.Width = numOfCells * cellSize + 3;
pnlGridDraw.Height = numOfCells * cellSize + 3;
if (this.Width < pnlGridDraw.Width)
this.Width = pnlGridDraw.Width + 5;
for (int i = 0; i <= numOfCells; i++)
{
g.DrawLine(Pens.Black, i * cellSize, 0, i * cellSize, numOfCells * cellSize);
g.DrawLine(Pens.Black, 0, i * cellSize, numOfCells * cellSize, i * cellSize);
}
int y;
TextBox myTextBox;
for (int i = 0; i < numOfCells; i++)
{
for (int j = 0; j < numOfCells; j++)
{
myTextBox = new TextBox();
y = j * cellSize;
myTextBox.Text = Cells[i, j].ToString();
myTextBox.TextAlign = HorizontalAlignment.Center;
myTextBox.Size = new Size(cellSize - 2, cellSize);
myTextBox.Location = new Point(j * cellSize + pnlGridDraw.Location.X + 2, pnlGridDraw.Location.Y + i * cellSize);
this.Controls.Add(myTextBox);
textboxes.Add(myTextBox);
myTextBox.BorderStyle = BorderStyle.Fixed3D;
myTextBox.Enabled = true;
//t.ReadOnly = true;
myTextBox.Show();
myTextBox.BringToFront();
//t.MouseClick += text_MouseClick;
myTextBox.MouseClick += text_MouseClick;
}
}
this.Invalidate();
}
示例13: refreshList
private void refreshList()
{
int c = (int)numericUpDown1.Value;
while (c < Names.Count)
{
Names[c].Dispose();
Names.RemoveAt(c);
Weights[c].Dispose();
Weights.RemoveAt(c);
}
while (c > Names.Count)
{
TextBox box = new TextBox();
box.Parent = panelSubtasks;
box.Left = 10;
box.Top = 25 + 30 * Names.Count;
box.Show();
Names.Add(box);
TrackBar bar = new TrackBar();
bar.Parent = panelSubtasks;
bar.Left = box.Width + 20;
bar.Top = 25 + 30 * Weights.Count;
bar.Width = 200;
bar.Minimum = 0;
bar.Maximum = 100;
bar.Value = 50;
bar.BringToFront();
bar.Show();
bar.Scroll += new System.EventHandler(refreshBars);
Weights.Add(bar);
}
bool b = checkBoxSameName.Checked;
textBoxSubtasksName.Enabled = b;
int i = 1;
foreach (TextBox name in Names)
{
name.Enabled = !b;
if (b) name.Text = textBoxSubtasksName.Text + ' ' + i.ToString();
i++;
}
}
示例14: populateUsers
// Yeah, yeah, so I should probably make this accept params. We'll see if it happens later on.
private void populateUsers()
{
// Also shoutout to automatic definition handling
// Ah, C#, it's great to be here again.
// Go through each user
// (could have also used the count from anything else that holds a user property)
for (int i = 0; i < Properties.Settings.Default.username.Count; i++)
{
int t = 0;
Panel uA = new Panel();
uA.Show();
uA.BackColor = Color.White;
//uA.BackColor = Color.FromName(Properties.Settings.Default.custColor[i]);
uA.Left = 0;
uA.Width = this.Width;
uA.Height = 50;
uA.Margin = new Padding(0, 2, 0, 0);
userList.Controls.Add(uA);
PictureBox pImg = new PictureBox();
pImg.Image = Image.FromFile(Properties.Settings.Default.userimgacc_path[i]);
pImg.Left = 0;
pImg.Width = 50;
pImg.Height = 50;
pImg.Dock = DockStyle.Left;
pImg.BackColor = Color.White;
pImg.SizeMode = PictureBoxSizeMode.Zoom;
Label turnip = new Label();
turnip.Show();
turnip.BackColor = Color.Transparent;
turnip.AutoEllipsis = true;
turnip.Left = 64;
turnip.Width = this.Width - 64 - 50;
turnip.Height = 50;
turnip.Top = 0;
turnip.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
turnip.ForeColor = Color.DimGray;
//turnip.ForeColor = Color.White;
turnip.TextAlign = ContentAlignment.MiddleLeft;
turnip.Text = Properties.Settings.Default.username[i];
uA.Controls.Add(pImg);
uA.Controls.Add(turnip);
Button dl = new Button();
dl.Show();
dl.BackColor = Color.Firebrick;
dl.Width = 50;
dl.Left = uA.Width - 50;
dl.Height = 50;
dl.Dock = DockStyle.Right;
dl.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
dl.ForeColor = Color.White;
dl.TextAlign = ContentAlignment.MiddleCenter;
dl.Text = "X";
dl.FlatStyle = FlatStyle.Flat;
dl.FlatAppearance.BorderSize = 0;
uA.Controls.Add(dl);
// Shhhhhhhhhhh hidden controls
Label toDel = new Label();
toDel.Show();
toDel.BackColor = Color.Transparent;
toDel.AutoEllipsis = true;
toDel.Left = 64;
toDel.Width = this.Width - 64 - 50;
toDel.Height = 18;
toDel.Top = 50;
toDel.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
toDel.ForeColor = Color.Red;
toDel.TextAlign = ContentAlignment.MiddleLeft;
toDel.Text = "To delete this account, enter the password:";
uA.Controls.Add(toDel);
TextBox pBox = new TextBox();
pBox.Show();
pBox.BackColor = Color.White;
pBox.Left = 64;
pBox.Width = this.Width - 64 - 60;
pBox.Top = 76;
pBox.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
pBox.ForeColor = Color.Black;
pBox.PasswordChar = '•';
pBox.BorderStyle = BorderStyle.FixedSingle;
uA.Controls.Add(pBox);
//.........这里部分代码省略.........
示例15: BuildSudokuTable
private void BuildSudokuTable()
{
cells = new TextBox[Program.TABLEWIDTH, Program.TABLEHEIGHT];
int yCellOffset = 1;
int xCellOffset = 1;
int hMargin = 2;
int vMargin = 0;
int hlineCellsCounter = 1;
int vLineCellsCounter = 1;
for (int i = 0; i < Program.TABLEWIDTH; i++)
{
for (int j = 0; j < Program.TABLEHEIGHT; j++)
{
TextBox cell = new TextBox();
cell.Parent = panelSudokuTable;
cell.BorderStyle = BorderStyle.FixedSingle;
cell.Location = new Point(40 * (xCellOffset - 1) + hMargin - 1, 30 * (yCellOffset - 1) + vMargin + 1);
cell.Width = 40;
cell.Height = 0;
cell.TextAlign = HorizontalAlignment.Center;
cell.MaxLength = 1;
cell.Font = Program.cellsFont;
cell.TextChanged += new EventHandler(cell_TextChanged);
cell.Show();
cells[i, j] = cell;
if (hlineCellsCounter % Program.CELLRANKGROUP == 0)
hMargin = hMargin + 2;
hlineCellsCounter++;
xCellOffset++;
}
if (vLineCellsCounter % Program.CELLRANKGROUP == 0)
vMargin = vMargin + 1;
vLineCellsCounter++;
hlineCellsCounter = 1;
xCellOffset = 1;
yCellOffset++;
hMargin = 2;
}
cellsRank = Program.MAXVALUE;
panelSudokuTable.Width = cells[Program.TABLEWIDTH - 1, Program.TABLEWIDTH - 1].Right + 1;
panelSudokuTable.Height = cells[Program.TABLEHEIGHT - 1, Program.TABLEHEIGHT - 1].Bottom + 1;
this.Width = panelSudokuTable.Width + 62;
this.Height = panelSudokuTable.Height + 188;
panelSudokuTable.Location = new Point(((groupBox1.Width - panelSudokuTable.Width) / 2),
((groupBox1.Height - panelSudokuTable.Height) / 2) + 3 );
}