Hi!
Having a datagrid wherefrom I, initially, remove the HScrollBar, I can't get the area where the bar was placed to act properly. The portion of my screen that is right behind this area shows through. Looks like the control's not redrawing itself. This works perfect when switching the parent Tab Page to another and then back - redrawing is done. But when I start the app and for the first time enters this tab page, the problem occurs.
I have tried to invalidate the entire datagrid, the rectangle corresponding to the HScrollBar (before it was removed) and then updating, but nothing happens. This is my code:
...
Dim rect As Rectangle
Dim h_scroll As New HScrollBar
Dim ctrlList As New ArrayList
For Each ctrl As Control In myGrid.Controls
If TypeOf ctrl Is HScrollBar Then
rect = New Rectangle(CType(ctrl, HScrollBar).Location, CType(ctrl, HScrollBar).Size)
edgAerendetyper.Controls.Remove(ctrl)
End If
Next
edgAerendetyper.Invalidate(rect)
' Tried with invalidate(True) also
edgAerendetyper.Update()
...
This code is executed just after setting the data source...
Any suggestions what's wrong ?
/Rickard
Having a datagrid wherefrom I, initially, remove the HScrollBar, I can't get the area where the bar was placed to act properly. The portion of my screen that is right behind this area shows through. Looks like the control's not redrawing itself. This works perfect when switching the parent Tab Page to another and then back - redrawing is done. But when I start the app and for the first time enters this tab page, the problem occurs.
I have tried to invalidate the entire datagrid, the rectangle corresponding to the HScrollBar (before it was removed) and then updating, but nothing happens. This is my code:
...
Dim rect As Rectangle
Dim h_scroll As New HScrollBar
Dim ctrlList As New ArrayList
For Each ctrl As Control In myGrid.Controls
If TypeOf ctrl Is HScrollBar Then
rect = New Rectangle(CType(ctrl, HScrollBar).Location, CType(ctrl, HScrollBar).Size)
edgAerendetyper.Controls.Remove(ctrl)
End If
Next
edgAerendetyper.Invalidate(rect)
' Tried with invalidate(True) also
edgAerendetyper.Update()
...
This code is executed just after setting the data source...
Any suggestions what's wrong ?
/Rickard