I have to assume this is easy and I am just unaware of how to do it, but how can I convert a string value to an object.
I have about 50 checkboxes that I want to allow a user to click and hide a column in a grid and I wanted
I was hoping to change my below code to the following but it errors with a string value for the ckbox name.
Dim Val as string = "Mail"
Dim colName as string = "col_" + Val
Dim chkbox as string = "chkbox_" + Val
columnOptions(colName, chkbox)
My code looks like:
Private Function columnOptions(ByVal colName as String, ByVal chkbox as Object)
if chkbox.checked = True Then
dgview_adUserListing.Columns(colName).Visible = True
Else
dgview_adUserListing.Columns(colName).Visible = False
End Function
Private Sub chkbx_Mail_CheckChanged(sender as Object, e as EventArgs) handles chkbox_Mail.CheckedChange
Dim colName As String = "col_Mail"
Dim chkbox As object = "chkbx_Mail
ColumnOPtions(colName, chkbox)
End Sub