Click here to Skip to main content
15,886,004 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: fill a webpage from vb.net 2010 Pin
Paul Conrad24-Sep-12 17:00
professionalPaul Conrad24-Sep-12 17:00 
QuestionSocket Voice Chat Pin
Sally samy24-Sep-12 4:33
Sally samy24-Sep-12 4:33 
AnswerRe: Socket Voice Chat Pin
Eddy Vluggen24-Sep-12 4:49
professionalEddy Vluggen24-Sep-12 4:49 
GeneralRe: Socket Voice Chat Pin
Sally samy24-Sep-12 5:03
Sally samy24-Sep-12 5:03 
AnswerRe: Socket Voice Chat Pin
Eddy Vluggen24-Sep-12 5:08
professionalEddy Vluggen24-Sep-12 5:08 
QuestionHow can I do to make my vb player be able to play in a specific portion of time Pin
sosthenes paul21-Sep-12 0:52
sosthenes paul21-Sep-12 0:52 
AnswerRe: How can I do to make my vb player be able to play in a specific portion of time Pin
Eddy Vluggen21-Sep-12 3:07
professionalEddy Vluggen21-Sep-12 3:07 
QuestionVisable Line Draw Pin
Member 939749920-Sep-12 21:25
Member 939749920-Sep-12 21:25 
Hello, i need help with this code to make the line visable as drawing and not just after. any help would be great
VB
Public Class Form1
     
        'The lines that have been drawn but not saved.
        Private lines As New List(Of Line)
     
        'The start point of the line currently being drawn.
        Private start As Point
     
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Place a blank image in the PictureBox control.
            Me.PictureBox1.Image = New Bitmap(Me.PictureBox1.Width, Me.PictureBox1.Height)
        End Sub
     
        Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
            'Remember the point at which the line started.
            Me.start = e.Location
        End Sub
     
        Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
            'Remember the point at which the line ended.
            Dim [end] As Point = e.Location
     
            'Add the new line to the list.
            Me.lines.Add(New Line(Me.start, [end]))
     
            Dim area As New Rectangle(Math.Min(Me.start.X, [end].X), _
                                      Math.Min(Me.start.Y, [end].Y), _
                                      Math.Abs(Me.start.X - [end].X), _
                                      Math.Abs(Me.start.Y - [end].Y))
     
            'Inflate the rectangle by 1 pixel in each direction to ensure every changed pixel will be redrawn.
            area.Inflate(1, 1)
     
            'Force the control to repaint so the new line is drawn.
            Me.PictureBox1.Invalidate(area)
            Me.PictureBox1.Update()
        End Sub
     
        Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
            'Draw each line on the control.
            Me.DrawLines(e.Graphics)
        End Sub
     
        Private Sub Save()
            'Create a Graphics object from the Image in the PictureBox.
            Using g As Graphics = Graphics.FromImage(Me.PictureBox1.Image)
                'Draw each line on the image to make them permanent.
                Me.DrawLines(g)
            End Using
     
            'Clear the temporary lines that were just saved.
            Me.Clear()
        End Sub
     
        Private Sub Clear()
            'Clear all unsaved lines.
            Me.lines.Clear()
     
            'Force the control to repaint so the lines are removed.
            Me.PictureBox1.Refresh()
        End Sub
     
        Private Sub DrawLines(ByVal g As Graphics)
            For Each line As Line In Me.lines
                g.DrawLine(Pens.Black, line.Start, line.End)
            Next line
        End Sub
     
    End Class
     
    Public Class Line
     
        'The line's start point.
        Private _start As Point
     
        'The line's end point.
        Private _end As Point
     
        'The line's start point.
        Public Property Start() As Point
            Get
                Return Me._start
            End Get
            Set(ByVal value As Point)
                Me._start = value
            End Set
        End Property
     
        'The line's end point.
        Public Property [End]() As Point
            Get
                Return Me._end
            End Get
            Set(ByVal value As Point)
                Me._end = value
            End Set
        End Property
     
        Public Sub New()
            Me.New(Point.Empty, Point.Empty)
        End Sub
     
        Public Sub New(ByVal start As Point, ByVal [end] As Point)
            Me._start = start
            Me._end = [end]
        End Sub
     
    End Class

AnswerRe: Visable Line Draw Pin
Eddy Vluggen21-Sep-12 3:02
professionalEddy Vluggen21-Sep-12 3:02 
GeneralRe: Visable Line Draw Pin
Member 939749921-Sep-12 8:56
Member 939749921-Sep-12 8:56 
GeneralRe: Visable Line Draw Pin
Richard MacCutchan21-Sep-12 21:19
mveRichard MacCutchan21-Sep-12 21:19 
GeneralRe: Visable Line Draw Pin
Eddy Vluggen21-Sep-12 22:53
professionalEddy Vluggen21-Sep-12 22:53 
AnswerRe: Visable Line Draw Pin
Richard MacCutchan21-Sep-12 3:20
mveRichard MacCutchan21-Sep-12 3:20 
Questionvb 6.0 API Pin
Ainnop20-Sep-12 4:15
Ainnop20-Sep-12 4:15 
AnswerRe: vb 6.0 API Pin
Wes Aday20-Sep-12 4:26
professionalWes Aday20-Sep-12 4:26 
GeneralRe: vb 6.0 API Pin
Ainnop20-Sep-12 4:46
Ainnop20-Sep-12 4:46 
AnswerRe: vb 6.0 API Pin
Eddy Vluggen20-Sep-12 4:48
professionalEddy Vluggen20-Sep-12 4:48 
GeneralRe: vb 6.0 API Pin
Wes Aday20-Sep-12 4:52
professionalWes Aday20-Sep-12 4:52 
GeneralRe: vb 6.0 API Pin
Member 939749921-Sep-12 8:51
Member 939749921-Sep-12 8:51 
GeneralRe: vb 6.0 API Pin
Wes Aday21-Sep-12 8:54
professionalWes Aday21-Sep-12 8:54 
AnswerRe: vb 6.0 API Pin
Joan M20-Sep-12 6:37
professionalJoan M20-Sep-12 6:37 
Questionvb 2008 methods Pin
dcof18-Sep-12 8:28
dcof18-Sep-12 8:28 
AnswerRe: vb 2008 methods Pin
Richard MacCutchan18-Sep-12 9:44
mveRichard MacCutchan18-Sep-12 9:44 
GeneralRe: vb 2008 methods Pin
dcof19-Sep-12 4:04
dcof19-Sep-12 4:04 
GeneralRe: vb 2008 methods Pin
Steven St. John19-Sep-12 4:19
Steven St. John19-Sep-12 4:19 

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.