I have two forms. How can I access a textbox on one form from the other form

One way to do this is to make the TextBox either a public property or a public field. Then you will be able to access it through the instance of its parent form. So, if TextBox1 is a public member of FormA and myFormA is an instance of FormA, then you can use code such as [VB.NET] Dim strValue as String = myFormA.TextBox1.Text [C#] string strValue = myFormA.TextBox1.Text; anywhere myFormA is known. Here is a VB project illustrating this technique.

How can I autosize a column in my datagrid

One way to do this is to use MeasureString to compute the size of the text in each cell, and then take the maximum value. Below is a code snippet that does this. It assumes your datagrid is bound to a datatable. You can download a full working sample. (C#,VB). public void AutoSizeCol(int col) { float width = 0; int numRows = ((DataTable) dataGrid1.DataSource).Rows.Count; Graphics g = Graphics.FromHwnd(dataGrid1.Handle); StringFormat sf = new StringFormat(StringFormat.GenericTypographic); SizeF size; for(int i = 0; i < numRows; ++ i) { size = g.MeasureString(dataGrid1[i, col].ToString(), dataGrid1.Font, 500, sf); if(size.Width > width) width = size.Width; } g.Dispose(); dataGrid1.TableStyles[”customers”].GridColumnStyles[col].Width = (int) width + 8; // 8 is for leading and trailing padding }

How can I make my last column wide enough to exactly occupy all the client area of the datagrid

If you have added a TableStyle for your grid, then the code below should set the right column width to be the empty space from a button click. If you need to dynamically do this in response to the user sizing other columns, then there may be more work. But if you only need to do it at the end of your Form_Load, then this code might be sufficient. It assumes your datasource is a datatable. You can download a sample project (C#, VB). private void button1_Click(object sender, System.EventArgs e) { int numCols = ((DataTable)(dataGrid1.DataSource)).Columns.Count; //the fudge -4 is for the grid borders int targetWidth = dataGrid1.ClientSize.Width – SystemInformation.VerticalScrollBarWidth – 4; int runningWidthUsed = this.dataGrid1.TableStyles[”customers”].RowHeaderWidth; for(int i = 0; i < numCols – 1; ++i) runningWidthUsed += this.dataGrid1.TableStyles[”customers”].GridColumnStyles[i].Width; if(runningWidthUsed < targetWidth) this.dataGrid1.TableStyles[”customers”].GridColumnStyles[numCols – 1].Width = targetWidth – runningWidthUsed; }

How can I catch the bool values changing in a DataGridBoolColumn

There is no event fired when the boolean value changes. In the attached sample (C#, VB), a BoolValueChanged event has been added to a columnstyle derived from DataGridBoolColumn. Catching the changes requires some effort. The strategy is to save the current value when the cell begins being edited. This is done in an override of Edit. Then in a Paint override, checks are done to see if there is a click in the checkbox cell or if the space bar is hit. If either of these situations happen when the cell is actively being edited, the bool value is changed and the event fired.