#REGON "Used to redraw the display style of DataGrid" Private Sub FormatGridWithTables () DIM TS As New DataGridTableStyle 'is what DataGrid determines what is DataGrid?
DIM AcolumnTextColumn as DataGridTextBoxColumn 'To rewrite Dongdong
Ts.mappingname = dataGridtable.tablename
DIM Numcols as INTEGER
Numcols = dataGridtable.columns.count
DIM I as integer = 0
Do While (i AcolumnTextColumn = New DataGridTextBoxColumn 'Capture control of TEXTBOX AddHandler AcolumnTextColumn.TextBox.Enter, New EventHandler (Addressof TextBoxEnterHandler) 'To change the list name, please refer the Headertext value of the sentence AcolumnTextColumn.Headertext = DataGridTable.columns (i) .Columnname 'Changed the actual content acolumntextColumn.mappingName = DataGridtable.columns (i) .Columnname 'Automatic changing line width is not an acolumntextColumn.textbox.autosize = true' msgbox (acolumntextcolumn.Headertext.toString) 'debug.write (acolumnTextColumn.TextBox.width & "aa") 'Automatic change line width is not acolumnTextColumn.textBox.autosize = TRUE Ts.PreferredColumnWidth = acolumnTextColumn.TextBox.width () Ts.GridColumnStyles.add (acolumntextColumn) 'Add a custom Column style i = (i 1) Loop DataGrid1.tablestyles.clear () DataGrid1.tableStyles.Add (TS) 'Add a custom table style End Sub # end region #Region "When you click when you click, you will force the DataGrid to select a row, not a row," Private SUB TextBoxEnterHandler (Byval E AS ISTEM.EventArgs) DIM inner as control = sender Inner.visible = FALSE DataGrid1.select (DataGrid1.currentrowindex) End Sub # end region