Click here to Skip to main content
15,908,907 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionNo Connection? Pin
teknozwizard12-Dec-09 21:25
teknozwizard12-Dec-09 21:25 
QuestionHelp with VB 2008.NET, Please [modified] PinPopular
treashunter10-Dec-09 20:21
treashunter10-Dec-09 20:21 
AnswerRe: Help with VB 2008.NET, Please Pin
Johan Hakkesteegt10-Dec-09 22:27
Johan Hakkesteegt10-Dec-09 22:27 
GeneralRe: Help with VB 2008.NET, Please Pin
treashunter10-Dec-09 22:36
treashunter10-Dec-09 22:36 
GeneralRe: Help with VB 2008.NET, Please Pin
Tom Deketelaere10-Dec-09 23:42
professionalTom Deketelaere10-Dec-09 23:42 
GeneralRe: Help with VB 2008.NET, Please Pin
treashunter10-Dec-09 23:49
treashunter10-Dec-09 23:49 
GeneralRe: Help with VB 2008.NET, Please Pin
Tom Deketelaere10-Dec-09 23:57
professionalTom Deketelaere10-Dec-09 23:57 
GeneralRe: Help with VB 2008.NET, Please PinPopular
treashunter11-Dec-09 0:06
treashunter11-Dec-09 0:06 
I figured it out with the help of several different forums thanks alot guys! Heres the code i ended up with in case your curious.

Imports System.IO
Imports System.Windows.Forms.MouseEventArgs
Imports System.Windows.Forms.Form
Imports System.Windows.Forms.PaintEventArgs

Public Class Edtor
    Private gfx As Graphics
    Public user As String
    Private pathset As Boolean
    Dim button2 As Global.System.Boolean




    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form1.Visible = True
        Me.Visible = False
    End Sub

    Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk

    End Sub

    Private Sub Edtor_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        gfx.Dispose()
        
    End Sub

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

        gfx = Me.CreateGraphics()

    End Sub

    Public Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click

        If (Me.SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
            user = Me.SaveFileDialog1.FileName

        End If

    End Sub

    Public Sub Edtor_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove


        If RadioButton1.Checked = True Then

            If e.Button <> Windows.Forms.MouseButtons.Left Then Exit Sub
            Dim rect As Rectangle

            With rect
                .X = e.X - 1
                .Y = e.Y - 1
                .Height = 2
                .Width = .Height / .Height

                gfx.DrawRectangle(System.Drawing.Pens.Red, rect)

            End With
        End If
        If RadioButton2.Checked = True Then

            If e.Button <> Windows.Forms.MouseButtons.Left Then Exit Sub
            Dim rect As Rectangle
            With rect
                .X = e.X - 1
                .Y = e.Y - 1
                .Height = 2
                .Width = .Height / .Height


                gfx.DrawRectangle(System.Drawing.Pens.Blue, rect)

            End With
        End If
        If RadioButton3.Checked = True Then
            If e.Button <> Windows.Forms.MouseButtons.Left Then Exit Sub
            Dim rect As Rectangle

            With rect
                .X = e.X - 1
                .Y = e.Y - 1
                .Height = 2
                .Width = .Height / .Height

                gfx.DrawRectangle(System.Drawing.Pens.Black, rect)

            End With
        End If

    End Sub

    Private Sub drawonform(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint



        If pathset = True Then

            If button2 = True Then
                If (Form1.openDiag.ShowDialog() = Windows.Forms.DialogResult.OK) Then
                    user = Form1.openDiag.FileName
                End If
            End If

            ' Create image.
            Dim Newimage As Image = Image.FromFile(user)

            ' Create Point for upper-left corner of image.
            Dim ulCorner As New Point(100, 100)

            ' Draw image to screen.
            e.Graphics.DrawImage(Newimage, ulCorner)
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buttonpic.Click

        If (Form1.openDiag.ShowDialog() = Windows.Forms.DialogResult.OK) Then

            user = Form1.openDiag.FileName

            pathset = True

        End If
    End Sub
End Class

GeneralRe: Help with VB 2008.NET, Please Pin
dan!sh 11-Dec-09 0:11
professional dan!sh 11-Dec-09 0:11 
GeneralRe: Help with VB 2008.NET, Please Pin
The Man from U.N.C.L.E.11-Dec-09 23:06
The Man from U.N.C.L.E.11-Dec-09 23:06 
GeneralRe: Help with VB 2008.NET, Please Pin
Paul Conrad12-Dec-09 4:56
professionalPaul Conrad12-Dec-09 4:56 
GeneralRe: Help with VB 2008.NET, Please Pin
Johan Hakkesteegt11-Dec-09 2:37
Johan Hakkesteegt11-Dec-09 2:37 
AnswerRe: Help with VB 2008.NET, Please Pin
Paul Conrad12-Dec-09 4:59
professionalPaul Conrad12-Dec-09 4:59 
QuestionHow to check Internet connection Pin
Tufail Ahmad10-Dec-09 18:28
Tufail Ahmad10-Dec-09 18:28 
AnswerRe: How to check Internet connection Pin
Eddy Vluggen11-Dec-09 2:13
professionalEddy Vluggen11-Dec-09 2:13 
GeneralRe: How to check Internet connection Pin
Tufail Ahmad11-Dec-09 19:00
Tufail Ahmad11-Dec-09 19:00 
GeneralRe: How to check Internet connection Pin
The Man from U.N.C.L.E.11-Dec-09 23:09
The Man from U.N.C.L.E.11-Dec-09 23:09 
AnswerRe: How to check Internet connection Pin
εїзεїзεїз12-Dec-09 0:32
εїзεїзεїз12-Dec-09 0:32 
AnswerRe: How to check Internet connection Pin
Paul Conrad12-Dec-09 5:00
professionalPaul Conrad12-Dec-09 5:00 
QuestionWorking with numbers???? Pin
A-dogg200910-Dec-09 17:49
A-dogg200910-Dec-09 17:49 
AnswerRe: Working with numbers???? Pin
Ashfield10-Dec-09 21:08
Ashfield10-Dec-09 21:08 
GeneralRe: Working with numbers???? Pin
A-dogg200916-Dec-09 17:34
A-dogg200916-Dec-09 17:34 
QuestionLocal machine problem with SQL DMO !!! Pin
cotdot1111110-Dec-09 13:27
cotdot1111110-Dec-09 13:27 
AnswerRe: Local machine problem with SQL DMO !!! Pin
Luc Pattyn10-Dec-09 14:14
sitebuilderLuc Pattyn10-Dec-09 14:14 
AnswerRe: Local machine problem with SQL DMO !!! Pin
Eddy Vluggen11-Dec-09 2:20
professionalEddy Vluggen11-Dec-09 2:20 

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.