Always show vertical scrollbar in datgrid

M

Mikael Sorensen

Is there a way to always show the vertical scrollbar in a cf 1.0 datgrid?

With the full framework I use a custom control with something like:

Private Sub ShowScrollBars(ByVal sender As Object, ByVal e As
System.EventArgs)
'If the vertical scroll bar is not visible, set its size and display
it
With MyBase.VertScrollBar
If .Visible = False Then
.Location = New Point(ClientRectangle.Width - .Width -
BorderWidth, BorderWidth)
.Size = New Size(.Width, ClientRectangle.Height -
(BorderWidth * 2))
.Enabled = False
.Show()
End If
End With
End Sub

However MyBase.VertScrollBar is not supported by the compact framework.
How do I achieve what I want using the cf?

Alternatively - how do I - at runtime - detect if the scroolbar is shown, so
that I can resize the coloumns in the datagrid?

Regards,
Mikael
 
M

Mikael Sorensen

Thanks Sergey.

Works perfectly.

Best regards,
Mikael Sorensen

Sergey Bogdanov said:
See this:
http://blog.opennetcf.org/sbogdanov/PermaLink.aspx?guid=b03e36e9-8b33-4a84-9c30-a43a826c1c0f


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Mikael said:
Is there a way to always show the vertical scrollbar in a cf 1.0 datgrid?

With the full framework I use a custom control with something like:

Private Sub ShowScrollBars(ByVal sender As Object, ByVal e As
System.EventArgs)
'If the vertical scroll bar is not visible, set its size and display
it
With MyBase.VertScrollBar
If .Visible = False Then
.Location = New Point(ClientRectangle.Width - .Width -
BorderWidth, BorderWidth)
.Size = New Size(.Width, ClientRectangle.Height -
(BorderWidth * 2))
.Enabled = False
.Show()
End If
End With
End Sub

However MyBase.VertScrollBar is not supported by the compact framework.
How do I achieve what I want using the cf?

Alternatively - how do I - at runtime - detect if the scroolbar is shown, so
that I can resize the coloumns in the datagrid?

Regards,
Mikael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top