本文整理匯總了C#中System.Windows.Forms.TextBox.GetLength方法的典型用法代碼示例。如果您正苦於以下問題:C# TextBox.GetLength方法的具體用法?C# TextBox.GetLength怎麽用?C# TextBox.GetLength使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.GetLength方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ClearMatrix
/// <summary>
/// Метод, очищающает содержимое TextBox'ов.
/// </summary>
/// <param name = "TextBox"> Массив TextBox'ов </param>
public static void ClearMatrix(TextBox[,] TextBox)
{
for (int i = 0; i != TextBox.GetLength(0); i++)
for (int j = 0; j != TextBox.GetLength(1); j++)
{
TextBox[i, j].Text = "";
}
}
示例2: BoolCheck
/// <summary>
/// Метод, возвращает true, если TextBox'ы НЕ пустные, иначе - false.
/// </summary>
/// <param name = "TextBox"> Массив TextBox'ов </param>
public static bool BoolCheck(TextBox[,] TextBox)
{
for (int i = 0; i != TextBox.GetLength(0); i++)
for (int j = 0; j != TextBox.GetLength(1); j++)
{
if (TextBox[i, j].Text.Trim() == string.Empty) { return false; }
}
return true;
}
示例3: FillingRandomNumbers
/// <summary>
/// Метод, заполняет массив TextBox'ов случайными числами [-10:10].
/// </summary>
/// <param name = "TextBox"> Массив TextBox'ов </param>
public static void FillingRandomNumbers(TextBox[,] TextBox)
{
Random rng = new Random();
for (int i = 0; i != TextBox.GetLength(0); i++)
for (int j = 0; j != TextBox.GetLength(1); j++)
{
TextBox[i, j].Text = rng.Next(-10, 10).ToString();
}
}
示例4: crateMatrix
private void crateMatrix(TextBox[,] matrix_x, GroupBox matrix_box, NumericUpDown lines, NumericUpDown columns)
{
matrix_box.Controls.Clear();
int linha, coluna;
linha = Convert.ToInt32(lines.Value);
coluna = Convert.ToInt32(columns.Value);
matrix_x = new TextBox[linha, coluna];
for (int i = 0; i < matrix_x.GetLength(0); i++)
{
for (int j = 0; j < matrix_x.GetLength(1); j++)
{
matrix_x[i, j] = new TextBox();
matrix_x[i, j].Text = "0";
matrix_x[i, j].Top = (i * matrix_x[i, j].Height) + 100;
matrix_x[i, j].Left = j * 35 + 15;
matrix_x[i, j].Width = 30;
matrix_box.Controls.Add(matrix_x[i, j]);
}
}
}
示例5: checkTransp
private void checkTransp(TextBox[,] Matriz_x)
{
float[,] tempMatriz = new float[Matriz_x.GetLength(0), Matriz_x.GetLength(1)];
for (int i = 0; i < Matriz_x.GetLength(0); i++)
{
for (int j = 0; j < Matriz_x.GetLength(1); j++)
{
float k = 0;
if (float.TryParse(Matriz_x[i, j].Text, out k))
{
tempMatriz[i, j] = float.Parse(Matriz_x[i, j].Text);
}
}
}
float[,] answer = calculos.Transposta(tempMatriz);
for (int i = 0; i < answer.GetLength(0); i++)
{
for (int j = 0; j < answer.GetLength(1); j++)
{
Matriz_x[i, j].Text = "" + answer[i, j];
}
}
}
示例6: checkDet
private float checkDet(TextBox[,] Matriz_x)
{
float[,] tempMatriz = new float[Matriz_x.GetLength(0), Matriz_x.GetLength(1)];
for (int i = 0; i < Matriz_x.GetLength(0); i++)
{
for (int j = 0; j < Matriz_x.GetLength(1); j++)
{
float k = 0;
if (float.TryParse(Matriz_x[i, j].Text, out k))
{
tempMatriz[i, j] = float.Parse(Matriz_x[i, j].Text);
}
}
}
float answer = calculos.Determinante(tempMatriz);
return answer;
}