Author Topic: GAH! Visual Basic hates me!  (Read 587 times)

0 Members and 1 Guest are viewing this topic.

Offline Carl

  • Render artist
  • 211
    • http://www.3dap.com/hlp/
GAH! Visual Basic hates me!
anybody know what is wrong with this?

Code: [Select]
Public Class OFDSample
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents PromptFileNameLabel As System.Windows.Forms.Label
    Friend WithEvents FileNameLabel As System.Windows.Forms.Label
    Friend WithEvents DisplayImageButton As System.Windows.Forms.Button
    Friend WithEvents ClearButton As System.Windows.Forms.Button
    Friend WithEvents ExitButton As System.Windows.Forms.Button
    Friend WithEvents CurrentPictureBox As System.Windows.Forms.PictureBox
    Friend WithEvents PictureOpenFileDialog As System.Windows.Forms.OpenFileDialog
    Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(OFDSample))
        Me.PromptFileNameLabel = New System.Windows.Forms.Label
        Me.FileNameLabel = New System.Windows.Forms.Label
        Me.DisplayImageButton = New System.Windows.Forms.Button
        Me.ClearButton = New System.Windows.Forms.Button
        Me.ExitButton = New System.Windows.Forms.Button
        Me.CurrentPictureBox = New System.Windows.Forms.PictureBox
        Me.PictureOpenFileDialog = New System.Windows.Forms.OpenFileDialog
        Me.SuspendLayout()
        '
        'PromptFileNameLabel
        '
        Me.PromptFileNameLabel.BackColor = System.Drawing.Color.White
        Me.PromptFileNameLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.PromptFileNameLabel.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.PromptFileNameLabel.Location = New System.Drawing.Point(24, 24)
        Me.PromptFileNameLabel.Name = "PromptFileNameLabel"
        Me.PromptFileNameLabel.Size = New System.Drawing.Size(80, 20)
        Me.PromptFileNameLabel.TabIndex = 0
        Me.PromptFileNameLabel.Text = "File Name:"
        Me.PromptFileNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'FileNameLabel
        '
        Me.FileNameLabel.BackColor = System.Drawing.Color.White
        Me.FileNameLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.FileNameLabel.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FileNameLabel.Location = New System.Drawing.Point(128, 24)
        Me.FileNameLabel.Name = "FileNameLabel"
        Me.FileNameLabel.Size = New System.Drawing.Size(640, 20)
        Me.FileNameLabel.TabIndex = 1
        Me.FileNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'DisplayImageButton
        '
        Me.DisplayImageButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.DisplayImageButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.DisplayImageButton.Location = New System.Drawing.Point(353, 504)
        Me.DisplayImageButton.Name = "DisplayImageButton"
        Me.DisplayImageButton.Size = New System.Drawing.Size(88, 48)
        Me.DisplayImageButton.TabIndex = 2
        Me.DisplayImageButton.Text = "Display Image"
        '
        'ClearButton
        '
        Me.ClearButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.ClearButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ClearButton.Location = New System.Drawing.Point(241, 504)
        Me.ClearButton.Name = "ClearButton"
        Me.ClearButton.Size = New System.Drawing.Size(88, 48)
        Me.ClearButton.TabIndex = 3
        Me.ClearButton.Text = "Clear"
        '
        'ExitButton
        '
        Me.ExitButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.ExitButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ExitButton.Image = CType(resources.GetObject("ExitButton.Image"), System.Drawing.Image)
        Me.ExitButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.ExitButton.Location = New System.Drawing.Point(465, 504)
        Me.ExitButton.Name = "ExitButton"
        Me.ExitButton.Size = New System.Drawing.Size(88, 48)
        Me.ExitButton.TabIndex = 4
        Me.ExitButton.Text = "Exit"
        '
        'CurrentPictureBox
        '
        Me.CurrentPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.CurrentPictureBox.Location = New System.Drawing.Point(141, 72)
        Me.CurrentPictureBox.Name = "CurrentPictureBox"
        Me.CurrentPictureBox.Size = New System.Drawing.Size(512, 384)
        Me.CurrentPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.CurrentPictureBox.TabIndex = 5
        Me.CurrentPictureBox.TabStop = False
        '
        'PictureOpenFileDialog
        '
        '
        'OFDSample
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.LightGray
        Me.ClientSize = New System.Drawing.Size(794, 575)
        Me.Controls.Add(Me.CurrentPictureBox)
        Me.Controls.Add(Me.ExitButton)
        Me.Controls.Add(Me.ClearButton)
        Me.Controls.Add(Me.DisplayImageButton)
        Me.Controls.Add(Me.FileNameLabel)
        Me.Controls.Add(Me.PromptFileNameLabel)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Location = New System.Drawing.Point(72, 72)
        Me.MaximizeBox = False
        Me.Name = "OFDSample"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
        Me.Text = "Image Viewer"
        Me.ResumeLayout(False)

    End Sub

#End Region

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

    End Sub

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

    End Sub

    Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
        Me.Close()

    End Sub

    Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
        FileNameLabel.Text = ""
        CurrentPictureBox.Image = Nothing

    End Sub

    Private Sub DisplayImageButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisplayImageButton.Click
        PictureOpenFileDialog.ShowDialog()
        CurrentPictureBox.Image = Image.FromFile(PictureOpenFileDialog.FileName)
        FileNameLabel.Text = PictureOpenFileDialog.FileName

    End Sub
End Class
"Gunnery control, fry that ****er!" - nuclear1

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
GAH! Visual Basic hates me!
[smartass remark]It's written in Visual Basic.[/smartass remark] :p

Do you have any more info on what's going wrong?
-C

 

Offline Carl

  • Render artist
  • 211
    • http://www.3dap.com/hlp/
GAH! Visual Basic hates me!
application2.exe cannot be found.
"Gunnery control, fry that ****er!" - nuclear1

 
GAH! Visual Basic hates me!
That sounds more like a problem with your visual studio configuration then the code.

  
GAH! Visual Basic hates me!
Quote
Originally posted by WMCoolmon
[smartass remark]It's written in Visual Basic.[/smartass remark] :p


First thing I thought of, too.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker