Click here to Skip to main content
15,893,904 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralTAB control change tab order Pin
Mekong River12-Dec-04 14:14
Mekong River12-Dec-04 14:14 
GeneralRe: TAB control change tab order Pin
Tom John13-Dec-04 2:59
Tom John13-Dec-04 2:59 
GeneralRe: TAB control change tab order Pin
Mekong River13-Dec-04 17:30
Mekong River13-Dec-04 17:30 
GeneralRe: TAB control change tab order Pin
Tom John13-Dec-04 22:00
Tom John13-Dec-04 22:00 
GeneralRe: TAB control change tab order Pin
Mekong River14-Dec-04 10:56
Mekong River14-Dec-04 10:56 
GeneralRe: TAB control change tab order Pin
Tom John14-Dec-04 22:58
Tom John14-Dec-04 22:58 
GeneralNeed rectangle box with little compartments. Pin
preesteya12-Dec-04 14:12
preesteya12-Dec-04 14:12 
GeneralRe: Need rectangle box with little compartments. Pin
Tom John13-Dec-04 0:27
Tom John13-Dec-04 0:27 
Have a look at the GDI+ graphics object:

Here on MSDN[^]

http://www.bobpowell.net/[^] - Great stuff on GDI+

You can use this to draw on a control such as a form or a panel. The following code draws a grid on a panel (crudely):

Private columns As Integer = 5
Private rows As Integer = 4

Private Sub Form1_OnLoad(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load

    Dim newPanel As New Panel
    newPanel.BorderStyle = BorderStyle.FixedSingle
    newPanel.Location = New Point(20, 20)
    Me.Controls.Add(newPanel)
    AddHandler newPanel.Paint, AddressOf GridPaint

End Sub

Private Sub GridPaint(ByVal sender As Object, ByVal e As PaintEventArgs)

    Dim p As Panel = CType(sender, Panel)
    Dim g As Graphics = e.Graphics

    Dim width As Integer = CInt(p.Width / columns)
    Dim height As Integer = CInt(p.Height / rows)

    For x As Integer = width To p.Width Step width
        g.DrawLine(SystemPens.ControlDark, x, 0, x, p.Height)
    Next

    For y As Integer = height To p.Height Step height
        g.DrawLine(SystemPens.ControlDark, 0, y, p.Width, y)
    Next

End Sub


Hope this helps

Tom
QuestionHow to call a MouseEvent from a Keyboard Event Handler? Pin
manivannan.p12-Dec-04 6:29
manivannan.p12-Dec-04 6:29 
AnswerRe: How to call a MouseEvent from a Keyboard Event Handler? Pin
Dave Kreskowiak13-Dec-04 2:05
mveDave Kreskowiak13-Dec-04 2:05 
GeneralBeginner: converting stings and integers Pin
toefuti11-Dec-04 23:45
toefuti11-Dec-04 23:45 
GeneralRe: Beginner: converting stings and integers Pin
Edbert P12-Dec-04 13:37
Edbert P12-Dec-04 13:37 
GeneralRe: Beginner: converting stings and integers Pin
John Santora18-Dec-04 17:10
sussJohn Santora18-Dec-04 17:10 
GeneralRe: User Controls? Pin
Mekong River11-Dec-04 16:47
Mekong River11-Dec-04 16:47 
GeneralRe: User Controls? Pin
hermitbluedog12-Dec-04 2:14
hermitbluedog12-Dec-04 2:14 
Questionmore efficient mp3 control? Pin
Nadroj11-Dec-04 7:42
Nadroj11-Dec-04 7:42 
Generalvb dll Pin
Member 158209411-Dec-04 7:30
Member 158209411-Dec-04 7:30 
GeneralRe: vb dll Pin
Dave Kreskowiak11-Dec-04 9:43
mveDave Kreskowiak11-Dec-04 9:43 
GeneralRe: vb dll Pin
A.Kishior12-Dec-04 9:06
A.Kishior12-Dec-04 9:06 
GeneralVB .NET 03' Textbox using return key for entry Pin
SpinningCone11-Dec-04 6:32
sussSpinningCone11-Dec-04 6:32 
GeneralRe: VB .NET 03' Textbox using return key for entry Pin
MohammadAmiry11-Dec-04 22:47
MohammadAmiry11-Dec-04 22:47 
Generalvb6.0 email code asked for !!!!!!! Pin
Mohammad Daba'an10-Dec-04 22:53
Mohammad Daba'an10-Dec-04 22:53 
GeneralRe: vb6.0 email code asked for !!!!!!! Pin
Mekong River11-Dec-04 4:09
Mekong River11-Dec-04 4:09 
GeneralRe: vb6.0 email code asked for !!!!!!! Pin
Mohammad Daba'an12-Dec-04 21:05
Mohammad Daba'an12-Dec-04 21:05 
Questionhow to send a directory in lan messenger Pin
parada10-Dec-04 19:49
parada10-Dec-04 19:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.