Click here to Skip to main content
15,912,457 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 2:37
Member 1066669819-May-14 2:37 
GeneralRe: VBScript: Conversion XML to Excel Pin
Eddy Vluggen19-May-14 2:59
professionalEddy Vluggen19-May-14 2:59 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 3:10
Member 1066669819-May-14 3:10 
GeneralRe: VBScript: Conversion XML to Excel Pin
Chris Quinn19-May-14 3:15
Chris Quinn19-May-14 3:15 
GeneralRe: VBScript: Conversion XML to Excel Pin
Eddy Vluggen19-May-14 7:39
professionalEddy Vluggen19-May-14 7:39 
QuestionVB.Net 2008 Pin
Virendra Singh Bhanu16-May-14 0:29
Virendra Singh Bhanu16-May-14 0:29 
AnswerRe: VB.Net 2008 Pin
Richard MacCutchan16-May-14 0:50
mveRichard MacCutchan16-May-14 0:50 
GeneralRe: VB.Net 2008 Pin
Virendra Singh Bhanu16-May-14 0:56
Virendra Singh Bhanu16-May-14 0:56 
GeneralRe: VB.Net 2008 Pin
Richard MacCutchan16-May-14 1:14
mveRichard MacCutchan16-May-14 1:14 
QuestionRe: VB.Net 2008 Pin
Eddy Vluggen16-May-14 3:02
professionalEddy Vluggen16-May-14 3:02 
QuestionList(Of ObjectWithProperties) distinct property values Pin
Johan Hakkesteegt15-May-14 3:32
Johan Hakkesteegt15-May-14 3:32 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
Richard MacCutchan15-May-14 3:49
mveRichard MacCutchan15-May-14 3:49 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
David Mujica15-May-14 6:32
David Mujica15-May-14 6:32 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
Eddy Vluggen15-May-14 7:53
professionalEddy Vluggen15-May-14 7:53 
GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Johan Hakkesteegt15-May-14 20:16
Johan Hakkesteegt15-May-14 20:16 
GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Mycroft Holmes15-May-14 22:41
professionalMycroft Holmes15-May-14 22:41 
QuestionWindow Service Does Not Stay "Alive" While Running Pin
ToolTimeTabor14-May-14 15:13
ToolTimeTabor14-May-14 15:13 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
Bernhard Hiller14-May-14 21:51
Bernhard Hiller14-May-14 21:51 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
Eddy Vluggen15-May-14 3:00
professionalEddy Vluggen15-May-14 3:00 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
David Mujica15-May-14 6:25
David Mujica15-May-14 6:25 
QuestionIf/and Statements Pin
David Rubin13-May-14 12:34
David Rubin13-May-14 12:34 
AnswerRe: If/and Statements Pin
Peter Leow13-May-14 14:33
professionalPeter Leow13-May-14 14:33 
AnswerRe: If/and Statements Pin
charliedev14-May-14 19:20
charliedev14-May-14 19:20 
Questionsave images as .gif Pin
khei-chan00712-May-14 17:44
khei-chan00712-May-14 17:44 
Hi guys,
i have codes that displaying different images as gif in one picturebox. My problem is, how can i save this .gif i mydocuments?
here is my codes..

thank you in advance! Smile | :)

VB
Public Class Form7

    Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PictureBox1.BackColor = Color.Ivory
        PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox1.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox2.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox3.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox4.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox5.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox6.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox7.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            TextBox8.Text = (OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

        Timer1.Enabled = True
        Timer1.Start()

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        Dim max As Integer = 500
        Dim rnd As New Random
        Dim rand As Integer = rnd.Next(5, max + 1)

        Dim i As Integer = 1
        Dim number(max - 1) As Integer
        For i = 0 To max - 1
            If number(i) = rand Then
                rand = rnd.Next(1, max + 1)
                i = -1
            ElseIf number(i) = 0 Then
                number(i) = rand
                rand = rnd.Next(1, max + 1)
                If i = max - 1 Then
                    Exit For
                End If
                i = -1
            End If
        Next
        Timer1.Interval = number(i)
        i += 1
        ChangeImage()

    End Sub

    Private Sub ChangeImage()

        Static Dim iImage1 As Integer

        Select Case iImage1
            Case 0
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox1.Text)
                iImage1 += 1
            Case 1
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox2.Text)
                iImage1 += 1
            Case 2
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox3.Text)
                iImage1 += 1
            Case 3
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox4.Text)
                iImage1 += 1
            Case 4
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox5.Text)
                iImage1 += 1
            Case 5
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox6.Text)
                iImage1 += 1
            Case 6
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox7.Text)
                iImage1 += 1
            Case 7
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox8.Text)
                iImage1 += 1
            Case 8
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox9.Text)
                iImage1 += 1
            Case 9
                PictureBox1.Visible = True
                PictureBox1.Image = Image.FromFile(TextBox10.Text)
                iImage1 = 0
        End Select
    End Sub

End Class


modified 13-May-14 3:20am.

AnswerRe: save images as .gif Pin
Chris Quinn12-May-14 20:56
Chris Quinn12-May-14 20:56 

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.