Hello All,
This has really has got me stumped. I have some columns which I created inside a panel control using the creategraphics class.
I know the graphics I'm creating is larger than the panel itself yet when I change the panel autoscroll property to true and the autoscrollmin, no scroll bar appears.
I can't seem to get the horizontal scrolling bar to appear no matter what I do. Can someone help me to better understand why this is happening?
Code:
Private Sub Draw_Columns(ByVal NumberOfColumns As Integer)
Dim grfx2 As Graphics = Panel1.CreateGraphics
Dim grfx3 As Graphics = Panel2.CreateGraphics
Dim I As Integer
Dim days As Integer
Dim Weekend As Boolean = False
Dim Xlocation As Integer = (Panel1.Location.X - 12)
Dim XPanel2Location As Integer = Panel2.Location.X
For I = 1 To NumberOfColumns
'Draw Rectangle
grfx2.DrawRectangle(Pens.Black, New Rectangle(Xlocation, Panel1.Location.Y - 76, 21, Panel1.Height))
days += 1
If days = 6 Then
'Fill Rectangle
grfx2.FillRectangle(Brushes.SkyBlue, New Rectangle(Xlocation, Panel1.Location.Y - 76, 20, Panel1.Height))
ElseIf days = 7 Then
grfx2.FillRectangle(Brushes.SkyBlue, New Rectangle(Xlocation, Panel1.Location.Y - 76, 20, Panel1.Height))
days = 0
End If
Xlocation += 21
If I <= 9 Then
grfx3.DrawString(I, New Font("VERDANA", 8, FontStyle.Regular, GraphicsUnit.Point), Brushes.Black, XPanel2Location - 8, Panel2.Location.Y - 35)
Else
grfx3.DrawString(I, New Font("VERDANA", 8, FontStyle.Regular, GraphicsUnit.Point), Brushes.Black, XPanel2Location - 12, Panel2.Location.Y - 35)
End If
XPanel2Location += 21
Next
End Sub
Regards
This has really has got me stumped. I have some columns which I created inside a panel control using the creategraphics class.
I know the graphics I'm creating is larger than the panel itself yet when I change the panel autoscroll property to true and the autoscrollmin, no scroll bar appears.
I can't seem to get the horizontal scrolling bar to appear no matter what I do. Can someone help me to better understand why this is happening?
Code:
Private Sub Draw_Columns(ByVal NumberOfColumns As Integer)
Dim grfx2 As Graphics = Panel1.CreateGraphics
Dim grfx3 As Graphics = Panel2.CreateGraphics
Dim I As Integer
Dim days As Integer
Dim Weekend As Boolean = False
Dim Xlocation As Integer = (Panel1.Location.X - 12)
Dim XPanel2Location As Integer = Panel2.Location.X
For I = 1 To NumberOfColumns
'Draw Rectangle
grfx2.DrawRectangle(Pens.Black, New Rectangle(Xlocation, Panel1.Location.Y - 76, 21, Panel1.Height))
days += 1
If days = 6 Then
'Fill Rectangle
grfx2.FillRectangle(Brushes.SkyBlue, New Rectangle(Xlocation, Panel1.Location.Y - 76, 20, Panel1.Height))
ElseIf days = 7 Then
grfx2.FillRectangle(Brushes.SkyBlue, New Rectangle(Xlocation, Panel1.Location.Y - 76, 20, Panel1.Height))
days = 0
End If
Xlocation += 21
If I <= 9 Then
grfx3.DrawString(I, New Font("VERDANA", 8, FontStyle.Regular, GraphicsUnit.Point), Brushes.Black, XPanel2Location - 8, Panel2.Location.Y - 35)
Else
grfx3.DrawString(I, New Font("VERDANA", 8, FontStyle.Regular, GraphicsUnit.Point), Brushes.Black, XPanel2Location - 12, Panel2.Location.Y - 35)
End If
XPanel2Location += 21
Next
End Sub
Regards