Add toolbar on datagridview in VB.Net
I created a custom control that inherits a datagridview and add some
custom properties. I just add a toolbar control docked on top of it so it
can have functionalities like add row, delete row etc. but it displays
like this image below:
as you can see the columnheader was under the toolbox control...I just
want them not to overlap each other...please help.
EDIT
I just insert a custom property like this one:
Dim _Toolbox_ As Toolstrip
Dim _ShowToolbar As Boolean
Public Property ShowToolbar() As Boolean
Get
Return _ShowToolbar
End Get
Set(ByVal value As Boolean)
_ShowToolbar = value
If value = True Then
_Toolbox_ = New Toolstrip
MyBase.Controls.Add(_Toolbox_)
_Toolbox_.Dock = Windows.Forms.DockStyle.Top
_Toolbox_.Visible = True
Else
MyBase.Controls.Remove(_Toolbox_)
_Toolbox_ = Nothing
End If
End Set
End Property
No comments:
Post a Comment