Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / June 2005

Tip: Looking for answers? Try searching our database.

moving from 6 to NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simplefi - 23 Jun 2005 00:15 GMT
Hi all,
migrating from VB6 to VS.NET, day 1 problem
how to draw lines/circles/boxes/etc onto form.
Have ImageEdit toolbar, never goes active.
Am tyring my hand at Mobile 2003 app.
Help only referes to programming of Draw.Line
I don't think I'm way off.
Thanks - Simplefi
supra - 25 Jun 2005 10:42 GMT
http://www.vbdotnetheaven.com/Sections/GDI+.asp
look in google  drawline in vb.net

copy and paste it:
' Draw a border inside this rectangle.
Private Sub DrawBorder(ByVal gr As Graphics, ByVal rect As _
    Rectangle, ByVal border_style As BorderStyle, Optional _
    ByVal sunken As Boolean = True)
    Select Case border_style
        Case BorderStyle.FixedSingle
            rect.Width -= 1
            rect.Height -= 1
            gr.DrawRectangle(Pens.Black, rect)
        Case BorderStyle.Fixed3D
            Dim colors() As Color
            If sunken Then
                colors = New Color() { _
                    SystemColors.ControlDark, _
                    SystemColors.ControlDarkDark, _
                    SystemColors.ControlLightLight, _
                    SystemColors.ControlLight _
                }
            Else
                colors = New Color() { _
                    SystemColors.ControlLightLight, _
                    SystemColors.ControlLight, _
                    SystemColors.ControlDark, _
                    SystemColors.ControlDarkDark _
                }
            End If
            Dim p As Pen
            p = New Pen(colors(0))
            gr.DrawLine(p, rect.X, rect.Y + rect.Height - _
                1, rect.X, rect.Y)
            gr.DrawLine(p, rect.X, rect.Y, rect.X + _
                rect.Width - 1, rect.Y)
            p = New Pen(colors(1))
            gr.DrawLine(p, rect.X + 1, rect.Y + rect.Height _
                - 2, rect.X + 1, rect.Y + 1)
            gr.DrawLine(p, rect.X + 1, rect.Y + 1, rect.X + _
                rect.Width - 2, rect.Y + 1)
            p = New Pen(colors(2))
            gr.DrawLine(p, rect.X, rect.Y + rect.Height - _
                1, rect.X + rect.Width - 1, rect.Y + _
                rect.Height - 1)
            gr.DrawLine(p, rect.X + rect.Width - 1, rect.Y _
                + rect.Height - 1, rect.X + rect.Width - 1, _
                rect.Y)
            p = New Pen(colors(3))
            gr.DrawLine(p, rect.X + 1, rect.Y + rect.Height _
                - 2, rect.X + rect.Width - 2, rect.Y + _
                rect.Height - 2)
            gr.DrawLine(p, rect.X + rect.Width - 2, rect.Y _
                + rect.Height - 2, rect.X + rect.Width - 2, _
                rect.Y + 1)
    End Select
End Sub

> Hi all,
> migrating from VB6 to VS.NET, day 1 problem
[quoted text clipped - 4 lines]
> I don't think I'm way off.
> Thanks - Simplefi

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.