Неявное преобразование типа string в system windows forms textbox

I don't know what to do because the error is in the Form1.Designer.cs and because I have no experience in debugging that part of the program. //Form1 // this.AutoScaleDimensions = new System.Draw...

I don’t know what to do because the error is in the Form1.Designer.cs and because I have no experience in debugging that part of the program.

//Form1
// 
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(352, 246);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Generate Username";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);

Abbas's user avatar

Abbas

14k6 gold badges41 silver badges71 bronze badges

asked Jan 29, 2014 at 14:49

YellowSubmarine's user avatar

YellowSubmarineYellowSubmarine

1511 gold badge4 silver badges13 bronze badges

9

The error is on this.Name = «Form1»;

I suspect you have created a control named Name, which conflicts with the Name property of the window. Just rename the control to something else and it should work again.

answered Jan 29, 2014 at 14:52

Thomas Levesque's user avatar

Thomas LevesqueThomas Levesque

284k66 gold badges617 silver badges751 bronze badges

1

The error must come from somewhere else, there’s nothing here with a TextBox. The error is probably caused by assigning a string to a TextBox itself instead of assigning a string to the Text property of the TextBox.

Example:

TextBox tb = new TextBox();
tb = "Default text";

This should be:

TextBox tb = new TextBox();
tb.Text = "Default text";

Otherwise you have created a control with a name like Name or Text, in which case you’ll have to rename it to NameTextBox or something.

answered Jan 29, 2014 at 14:53

Abbas's user avatar

0

0 / 0 / 0

Регистрация: 22.03.2021

Сообщений: 64

1

.NET Core

22.04.2021, 21:43. Показов 2624. Ответов 1


Для вывода результатов работы программы, необходимо
использовать метод GetInformation() класса Person, задача которого будет
выводить строку, в которой будет содержаться текущая информация об
экземпляре класса: поля name, age, profession

Помогите, пожалуйста!!!!!!!!!!!!!
Не могу вывести результат. Выдает ошибку » ResultBox += new_person.GetInformation(); »
Пишет, что не удалось неявно преобразовать тип string в System.Windows.Forms.TextBox

Код самой программы:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace Приложение_ср3_пробное
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void label1_Click(object sender, EventArgs e)
        {
 
        }
 
        private void groupBox1_Enter(object sender, EventArgs e)
        {
 
        }
 
        private void label2_Click(object sender, EventArgs e)
        {
 
        }
 
        private void label3_Click(object sender, EventArgs e)
        {
 
        }
 
        private void NameBox_TextChanged(object sender, EventArgs e)
        {
            
 
            
        }
 
        private void AgeBox_TextChanged(object sender, EventArgs e)
        {
 
        }
 
        private void ProfessionBox_TextChanged(object sender, EventArgs e)
        {
 
        }
        
 
        private void StartButton_Click(object sender, EventArgs e)
        {
            Person new_person;
            if (NameBox.Text == "")
            {
                MessageBox.Show("Введите имя");
            }
 
            if (AgeBox.Text != "")
            {
                if (ProfessionBox.Text != "")
                {
                    new_person = new Person(NameBox.Text, Convert.ToInt32(AgeBox.Text), ProfessionBox.Text);
                }
                else
                {
                    new_person = new Person(NameBox.Text, Convert.ToInt32(AgeBox.Text));
                }
            }
            else
            {
                if (ProfessionBox.Text != "")
                {
 
                    new_person = new Person(NameBox.Text, 0, ProfessionBox.Text);
                }
                else
                {
                    new_person = new Person(NameBox.Text);
                }
 
 
            }
            ResultBox += new_person.GetInformation();
 
 
        }
        
        private void ResultBox_TextChanged(object sender, EventArgs e)
        {
            
        }
 
       
    }
    
}

Код класса Person:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Приложение_ср3_пробное
{
    class Person
    {
        string name;
        int age;
        string profession;
 
        public Person(string name)
        {
            this.name = name;
        }
 
        public Person(string name, int age)
        {
            this.name = name;
            this.age = age;
        }
        public Person(string name, string profession)
        {
            this.name = name;
            this.profession = profession;
        }
        public Person(string name, int age, string profession)
        {
            this.name = name;
            this.age = age;
            this.profession = profession;
        }
        public string GetInformation()
        {
            string information;
            information = " Имя: " + this.name + "; Возраст: " + this.age.ToString() + " ; Профессия: " + this.profession;
            return information;
            
        }
        
 
    }
    
}

Миниатюры

Не удалось неявно преобразовать тип string в System.Windows.Forms.TextBox
 

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



I’m building very basic BMI Calculator in C# and Win Forms using VS 2012, also I’m quite new to C#. I’m followed some examples and this code should work, but when run code, I’m getting those errors.

Error   3   Argument 1: cannot convert from 'System.Windows.Forms.TextBox' to 'string'  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  44  31  bmi_calc
Error   5   Argument 1: cannot convert from 'System.Windows.Forms.TextBox' to 'string'  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  45  31  bmi_calc
Error   1   Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'   c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  39  25  bmi_calc
Error   2   The best overloaded method match for 'double.Parse(string)' has some invalid arguments  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  44  17  bmi_calc
Error   4   The best overloaded method match for 'double.Parse(string)' has some invalid arguments  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  45  17  bmi_calc

Here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace bmi_calc
{
    public partial class Form1 : Form
    {
        double v;
        double t;
        double r;


        public Form1()
        {
            InitializeComponent();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            txtTezina.Clear(); //Btn that resets height and weight field values.
            txtVisina.Clear();
            txtBmiRez = "";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            v = Double.Parse (txtVisina);
            t = Double.Parse (txtTezina);

            r = t / (v * v);

            txtBmiRez.Text = String.Format("{0:f}", r);

        }

        private void button3_Click(object sender, EventArgs e)
        {
            Application.Exit(); // Close app
        }

    }
}

If someone could explain me this, I would be eternally grateful.

I’m building very basic BMI Calculator in C# and Win Forms using VS 2012, also I’m quite new to C#. I’m followed some examples and this code should work, but when run code, I’m getting those errors.

Error   3   Argument 1: cannot convert from 'System.Windows.Forms.TextBox' to 'string'  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  44  31  bmi_calc
Error   5   Argument 1: cannot convert from 'System.Windows.Forms.TextBox' to 'string'  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  45  31  bmi_calc
Error   1   Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'   c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  39  25  bmi_calc
Error   2   The best overloaded method match for 'double.Parse(string)' has some invalid arguments  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  44  17  bmi_calc
Error   4   The best overloaded method match for 'double.Parse(string)' has some invalid arguments  c:usersdelldocumentsvisual studio 2012Projectsbmi_calcbmi_calcForm1.cs  45  17  bmi_calc

Here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace bmi_calc
{
    public partial class Form1 : Form
    {
        double v;
        double t;
        double r;


        public Form1()
        {
            InitializeComponent();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            txtTezina.Clear(); //Btn that resets height and weight field values.
            txtVisina.Clear();
            txtBmiRez = "";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            v = Double.Parse (txtVisina);
            t = Double.Parse (txtTezina);

            r = t / (v * v);

            txtBmiRez.Text = String.Format("{0:f}", r);

        }

        private void button3_Click(object sender, EventArgs e)
        {
            Application.Exit(); // Close app
        }

    }
}

If someone could explain me this, I would be eternally grateful.

When developing a .NET application (i.e. in C#), under certain circumstances, you might get the error message: Cannot implicitly convert type ‘string’ to ‘System.Windows.Forms.DataGridViewTextBoxColumn

Example of Exception in Visual Studio when Using the Reserved Word "Name" as a DataGridView Column Name - SQLNetHub Article

Example of Exception in Visual Studio when Using the Reserved Word “Name” as a DataGridView Column Name.

Why you got the implicit conversion error

If you get the above error, then you have most probably set as a column name for one of your datagridview column the reserved word ‘name‘.

If you do this, then the compiler finds a conflict between the assignment of the form’s name and the DataGridview’s column name.


Get Started with .NET Programming Fast and Easy!

Check our online course titled “.NET Programming for Beginners – Windows Forms with C#.
(special limited-time discount included in link).

.NET Programming for Beginners: Windows Forms (C#) - Online Course

Learn how to implement Windows Forms projects in .NET using Visual Studio and C#, how to implement multithreading, how to create deployment packages and installers for your .NET Windows Forms apps using ClickOnce in Visual Studio, and more! 

Many live demonstrations and downloadable resources included!

Enroll from $14.99


How to resolve the issue

To resolve this issue just change the name of the DataGridView’s column to something else instead of “name”.

There is a reason there are reserved words not only in .NET byut in many other development platforms as well (i.e. SQL Server, etc.).

To this end, please make sure that you are not using any reserved words in your development work because if you use them, there is always the risk of a conflict with system routines like the above example.

Check this MSDN article for information about the words reserved by the linker.

Featured Online Courses:

  • Introduction to Azure Database for MySQL
  • Working with Python on Windows and SQL Server Databases
  • Boost SQL Server Database Performance with In-Memory OLTP
  • Introduction to Azure SQL Database for Beginners
  • Essential SQL Server Administration Tips
  • SQL Server Fundamentals – SQL Database for Beginners
  • Essential SQL Server Development Tips for SQL Developers
  • Introduction to Computer Programming for Beginners
  • .NET Programming for Beginners – Windows Forms with C#
  • SQL Server 2019: What’s New – New and Enhanced Features
  • Entity Framework: Getting Started – Complete Beginners Guide
  • How to Import and Export Data in SQL Server Databases
  • A Guide on How to Start and Monetize a Successful Blog

Artemakis Artemiou

Artemakis Artemiou is a Senior SQL Server Architect, Author, a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 20 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and {essentialDevTips.com}. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Moreover, Artemakis teaches on Udemy, you can check his courses here.

Views: 7,961

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit «Cookie Settings» to provide a controlled consent. Read More

Вопрос:

Моя форма с именем form2.vb имеет этот код.

Private Sub ADDRESS_TICKETDataGridView_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles ADDRESS_TICKETDataGridView.CellDoubleClick
Dim value As String = ADDRESS_TICKETDataGridView.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString()
If e.ColumnIndex = e.ColumnIndex Then
Search.Show()
Search.TextBox1 = value



End If
End Sub
End Class

Но по ошибке мне кажется, что значение типа “String” не может быть преобразовано в “System.Windows.Forms.TextBox”. Я хочу исправить эту проблему, по сути, хочу, чтобы получить значение из datagridview и ввести его в другую форму с текстовым полем. Может ли это быть сделано, или я делаю что-то неправильно. Пожалуйста помоги?

Лучший ответ:

Search.TextBox1 = value

Вы просто попытались назначить переменную TextBox1 для хранения строки вместо текстового поля.

Это не имеет никакого смысла.

Вместо этого вы хотите установить текст, отображаемый в текстовом поле, установив его свойство Text.

Ответ №1

Просто для информации (и для добавления в мой комментарий к Slacks answer), есть способ приблизиться к этому поведению, используя перегрузку операторов. (Код находится на С#, но я предполагаю, что он легко переводится в VB.Net)

Просто создайте класс, наследующий TextBox следующим образом:

public class MyTextBox : TextBox
{
public static implicit operator string(MyTextBox t)
{
return t.Text;
}

public static implicit operator MyTextBox(string s)
{
MyTextBox tb = new MyTextBox();
tb.Text = s;
return tb;
}

public static MyTextBox operator +(MyTextBox tb1, MyTextBox tb2)
{
tb1.Text += tb2.Text;
return tb1;
}
}

И тогда вы сможете делать такие вещи:

MyTextBox tb = new MyTextBox();
tb.Text = "Hello ";
tb += "World";

Тогда содержимое вашего текстового поля будет Hello World

Я попытался заставить его работать с tb = "test", но не удалось.

Содержание

  1. Не удается преобразовать из «string» в «System.Windows.Forms.TextBox»
  2. Data Grid View Text Box Column Класс
  3. Определение
  4. Примеры
  5. Комментарии
  6. Примечания для тех, кто наследует этот метод
  7. Конструкторы
  8. Свойства
  9. Методы
  10. События

Не удается преобразовать из «string» в «System.Windows.Forms.TextBox»

Здравствуйте! Кто-нибудь знает как исправить эту ошибку: Не удается преобразовать из «string» в «System.Windows.Forms.TextBox»

Ошибка возникает в функции:

Не удается неявно преобразовать тип «string» в «System.Windows.Forms.DataGridViewTextBoxColumn»
Привет, Работал работал в результате вот что появилось убрать не могу никак Ошибка такая.

Как исправить ошибку «Не удается преобразовать из «System.Windows.Forms.TextBox» в «bool»?
Функция: Proxy.Set(new WebProxy(«ip адрес», порт)); Хочу сделать что бы данные выводились из.

Как исправить ошибку ‘Не удается неявно преобразовать тип «System.Collections.Generic.IEnumerable » в «string»‘?
Не удается неявно преобразовать тип «System.Collections.Generic.IEnumerable » в «string». .

Рядовой, здравствуйте! Я переписал функцию так и сообщение исчезло:

Рядовой, спасибо за ссылку. Я применил ее к своему коду, но не знаю как сделать, чтобы считалось на каждом шаге: ввожу, например 2, нажимаю «+», и снова ввожу два, затем нажимаю любую из операций получаю 4, затем снова ввожу число и получаю общий результат. Вы можете помочь добиться такой функциональности?

Заказываю контрольные, курсовые, дипломные и любые другие студенческие работы здесь или здесь.

Неявное преобразование типа «int» в «System.Windows.Forms.TextBox» невозможно
Помогите! Я новичок в C#. Хочу сделать переводчик. Вот код. using System; using.

Неявное преобразование типа «int» в «System.Windows.Forms.TextBox» невозможно
Работаю понятное дело в Win Forms Подумал сделать небольшую калькуляционную программу, но вот.

Data Grid View Text Box Column Класс

Определение

Размещает коллекцию ячеек DataGridViewTextBoxCell. Hosts a collection of DataGridViewTextBoxCell cells.

Примеры

В следующем примере кода показано использование этого типа. The following code example illustrates the use of this type.

Комментарии

DataGridViewTextBoxColumnКласс является специализированным типом DataGridViewColumn класса, который используется для логического размещения ячеек, позволяющих отображать и изменять текстовые строки. The DataGridViewTextBoxColumn class is a specialized type of DataGridViewColumn class used to logically host cells that enable displaying and editing of text strings. DataGridViewTextBoxColumnУ объекта есть связанный DataGridViewTextBoxCell объект, каждый из DataGridViewRow которых пересекает его. A DataGridViewTextBoxColumn has an associated DataGridViewTextBoxCell object in every DataGridViewRow that intersects it. Когда DataGridViewTextBoxCell активируется, он предоставляет DataGridViewTextBoxEditingControl элемент управления для выполнения ввода данных пользователем. When a DataGridViewTextBoxCell becomes activated, it supplies a DataGridViewTextBoxEditingControl control to handle user input.

По умолчанию для этого типа столбца используется режим сортировки Automatic . The sort mode for this column type defaults to Automatic.

Примечания для тех, кто наследует этот метод

При наследовании от DataGridViewTextBoxColumn и добавлении новых свойств в производный класс обязательно Переопределите Clone() метод, чтобы скопировать новые свойства во время операций клонирования. When you derive from DataGridViewTextBoxColumn and add new properties to the derived class, be sure to override the Clone() method to copy the new properties during cloning operations. Также следует вызвать метод базового класса, Clone() чтобы свойства базового класса копировались в новую ячейку. You should also call the base class’s Clone() method so that the properties of the base class are copied to the new cell.

Конструкторы

Инициализирует новый экземпляр класса DataGridViewTextBoxColumn, устанавливая его в состояние по умолчанию. Initializes a new instance of the DataGridViewTextBoxColumn class to the default state.

Свойства

Возвращает или задает режим, в котором автоматически изменяется ширина столбца. Gets or sets the mode by which the column automatically adjusts its width.

(Унаследовано от DataGridViewColumn) CellTemplate

Получает или задает шаблон, используемый для моделирования внешнего вида ячеек. Gets or sets the template used to model cell appearance.

Возвращает тип времени выполнения шаблона ячеек. Gets the run-time type of the cell template.

(Унаследовано от DataGridViewColumn) ContextMenuStrip

Возвращает или задает контекстное меню для столбца. Gets or sets the shortcut menu for the column.

(Унаследовано от DataGridViewColumn) DataGridView

Получает элемент управления DataGridView, связанный с данным элементом. Gets the DataGridView control associated with this element.

(Унаследовано от DataGridViewElement) DataPropertyName

Возвращает или задает имя того свойства данных или столбца базы данных в источнике данных, с которым связан столбец DataGridViewColumn. Gets or sets the name of the data source property or database column to which the DataGridViewColumn is bound.

(Унаследовано от DataGridViewColumn) DefaultCellStyle

Возвращает или задает стиль по умолчанию для ячеек столбца. Gets or sets the column’s default cell style.

(Унаследовано от DataGridViewColumn) DefaultHeaderCellType

Получает или задает тип времени выполнения для ячейки заголовка по умолчанию. Gets or sets the run-time type of the default header cell.

(Унаследовано от DataGridViewBand) Displayed

Получает значение, показывающее, отображается ли диапазон на экране в данный момент. Gets a value indicating whether the band is currently displayed onscreen.

(Унаследовано от DataGridViewBand) DisplayIndex

Возвращает или задает расположение столбца относительно столбцов, отображаемых в текущий момент. Gets or sets the display order of the column relative to the currently displayed columns.

(Унаследовано от DataGridViewColumn) DividerWidth

Возвращает или задает ширину (в пикселях) разделителя столбца. Gets or sets the width, in pixels, of the column divider.

(Унаследовано от DataGridViewColumn) FillWeight

Возвращает или задает значение, представляющее ширину столбца, находящегося в режиме заполнения, относительно ширины других столбцов элемента управления, находящихся в этом режиме. Gets or sets a value that represents the width of the column when it is in fill mode relative to the widths of other fill-mode columns in the control.

(Унаследовано от DataGridViewColumn)

Frozen

Возвращает или задает значение, указывающее, перемещается ли столбец, когда пользователь выполняет горизонтальную прокрутку элемента управления DataGridView. Gets or sets a value indicating whether a column will move when a user scrolls the DataGridView control horizontally.

(Унаследовано от DataGridViewColumn) HasDefaultCellStyle

Получает значение, показывающее, было ли установлено свойство DefaultCellStyle. Gets a value indicating whether the DefaultCellStyle property has been set.

(Унаследовано от DataGridViewBand) HeaderCell

Возвращает или задает объект DataGridViewColumnHeaderCell, представляющий заголовок столбца. Gets or sets the DataGridViewColumnHeaderCell that represents the column header.

(Унаследовано от DataGridViewColumn) HeaderCellCore

Получает или задает ячейку заголовка объекта DataGridViewBand. Gets or sets the header cell of the DataGridViewBand.

(Унаследовано от DataGridViewBand) HeaderText

Возвращает или задает текст ячейки заголовка столбца. Gets or sets the caption text on the column’s header cell.

(Унаследовано от DataGridViewColumn) Index

Получает относительную позицию диапазона в элементе управления DataGridView. Gets the relative position of the band within the DataGridView control.

(Унаследовано от DataGridViewBand) InheritedAutoSizeMode

Возвращает или задает режим изменения размера, действующий для столбца. Gets the sizing mode in effect for the column.

(Унаследовано от DataGridViewColumn) InheritedStyle

Возвращает стиль ячейки, применяемый в текущий момент к столбцу. Gets the cell style currently applied to the column.

(Унаследовано от DataGridViewColumn) IsDataBound

Возвращает значение, указывающее, связан ли столбец с источником данных. Gets a value indicating whether the column is bound to a data source.

(Унаследовано от DataGridViewColumn) IsRow

Получает значение, показывающее, представляет ли диапазон строку. Gets a value indicating whether the band represents a row.

(Унаследовано от DataGridViewBand) MaxInputLength

Получает или задает наибольшее количество символов, которое можно ввести в данное текстовое поле. Gets or sets the maximum number of characters that can be entered into the text box.

Возвращает или задает наименьшую ширину столбца (в пикселях). Gets or sets the minimum width, in pixels, of the column.

(Унаследовано от DataGridViewColumn) Name

Возвращает или задает имя столбца. Gets or sets the name of the column.

(Унаследовано от DataGridViewColumn) ReadOnly

Возвращает или задает значение, указывающее, может ли пользователь изменять ячейки столбца. Gets or sets a value indicating whether the user can edit the column’s cells.

(Унаследовано от DataGridViewColumn) Resizable

Возвращает или задает значение, указывающее, возможно ли изменение размера столбца. Gets or sets a value indicating whether the column is resizable.

(Унаследовано от DataGridViewColumn) Selected

Получает или задает значение, показывающее, выделен ли диапазон в пользовательском интерфейсе. Gets or sets a value indicating whether the band is in a selected user interface (UI) state.

(Унаследовано от DataGridViewBand) Site

Возвращает или задает подложку столбца. Gets or sets the site of the column.

(Унаследовано от DataGridViewColumn) SortMode

Возвращает или задает режим сортировки для столбца. Gets or sets the sort mode for the column.

Получает состояние пользовательского интерфейса для элемента. Gets the user interface (UI) state of the element.

(Унаследовано от DataGridViewElement) Tag

Получает или задает объект, содержащий данные, связанные с диапазоном. Gets or sets the object that contains data to associate with the band.

(Унаследовано от DataGridViewBand) ToolTipText

Возвращает или задает текст, используемый для подсказок. Gets or sets the text used for ToolTips.

(Унаследовано от DataGridViewColumn) ValueType

Возвращает или задает тип данных для значений в ячейках столбца. Gets or sets the data type of the values in the column’s cells.

(Унаследовано от DataGridViewColumn) Visible

Возвращает или задает значение, показывающее, видим ли столбец. Gets or sets a value indicating whether the column is visible.

(Унаследовано от DataGridViewColumn) Width

Возвращает или задает текущую ширину столбца. Gets or sets the current width of the column.

(Унаследовано от DataGridViewColumn)

Методы

Создает точную копию данного диапазона. Creates an exact copy of this band.

(Унаследовано от DataGridViewColumn) Dispose()

Освобождает все ресурсы, занятые модулем DataGridViewBand. Releases all resources used by the DataGridViewBand.

(Унаследовано от DataGridViewBand) Dispose(Boolean)

Освобождает неуправляемые ресурсы, используемые объектом DataGridViewBand, а при необходимости освобождает также управляемые ресурсы. Releases the unmanaged resources used by the DataGridViewBand and optionally releases the managed resources.

(Унаследовано от DataGridViewColumn) Equals(Object)

Определяет, равен ли указанный объект текущему объекту. Determines whether the specified object is equal to the current object.

(Унаследовано от Object) GetHashCode()

Служит хэш-функцией по умолчанию. Serves as the default hash function.

(Унаследовано от Object) GetPreferredWidth(DataGridViewAutoSizeColumnMode, Boolean)

Вычисляет оптимальную ширину столбца на основе указанных критериев. Calculates the ideal width of the column based on the specified criteria.

(Унаследовано от DataGridViewColumn) GetType()

Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.

(Унаследовано от Object) MemberwiseClone()

Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.

(Унаследовано от Object) OnDataGridViewChanged()

Вызывается, когда диапазон связан с другим элементом управления DataGridView. Called when the band is associated with a different DataGridView.

(Унаследовано от DataGridViewBand) RaiseCellClick(DataGridViewCellEventArgs)

Вызывает событие CellClick. Raises the CellClick event.

(Унаследовано от DataGridViewElement) RaiseCellContentClick(DataGridViewCellEventArgs)

Вызывает событие CellContentClick. Raises the CellContentClick event.

(Унаследовано от DataGridViewElement) RaiseCellContentDoubleClick(DataGridViewCellEventArgs)

(Унаследовано от DataGridViewElement) RaiseCellValueChanged(DataGridViewCellEventArgs)

Вызывает событие CellValueChanged. Raises the CellValueChanged event.

(Унаследовано от DataGridViewElement) RaiseDataError(DataGridViewDataErrorEventArgs)

Вызывает событие DataError. Raises the DataError event.

(Унаследовано от DataGridViewElement) RaiseMouseWheel(MouseEventArgs)

Вызывает событие MouseWheel. Raises the MouseWheel event.

(Унаследовано от DataGridViewElement) ToString()

Возвращает строку, описывающую столбец. Gets a string that describes the column.

События

Происходит при удалении объекта DataGridViewColumn. Occurs when the DataGridViewColumn is disposed.

Понравилась статья? Поделить с друзьями:
  • Новогодняя гирлянда на рабочий стол windows 10
  • Новогодние часы на рабочий стол windows 10 скачать бесплатно
  • Новогодние украшения на рабочий стол для windows 10
  • Нечеткое отображение шрифтов в windows 10
  • Новогодние темы на компьютер windows 10 бесплатно