Class Question

  • Thread starter Thread starter Stan Sainte-Rose
  • Start date Start date
S

Stan Sainte-Rose

Hi,
I thank everybody who helps me on my previous post..
It works :-)

So, I would like understand something about the class concept.

I create a Class for the datagrid called DataGridEnter.
So when I design a datagrid into my winform, the code is generated in the
#Region
with this syntax
Friend WithEvents dgLcl As System.Windows.Forms.DataGrid

Does it mean I have to update this code with

Friend WithEvents dgLcl As DataGridEnter

Or is there another method to accomplish this ?

Stan
 
You need to

1.) Declare this at Class Level
2.) In your constructor after InitializeComponent
Initialise it

Me.DataGrid2 = New SubGrid
CType(Me.DataGrid2, System.ComponentModel.ISupportInitialize).BeginInit()
'Add any initialization after the InitializeComponent() call
Me.DataGrid2.DataMember = ""
Me.DataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid2.Location = New System.Drawing.Point(300, 72)
Me.DataGrid2.Name = "DataGrid1"
Me.DataGrid2.Size = New System.Drawing.Size(184, 128)
Me.DataGrid2.TabIndex = 0
Me.Controls.Add(DataGrid2)
Regards - OHM
 
Thanks

And it seems that I have to do it in the
System.diagnostics.DebuggerStepThrough section..
Right ?

Stan
 
Back
Top