Click here to Skip to main content
15,895,142 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VB Script Help For Microsoft Excel Pin
Johan Hakkesteegt3-May-10 22:23
Johan Hakkesteegt3-May-10 22:23 
QuestionWhich is the best way to set default value for properties Pin
andiyuniar27-Apr-10 17:40
andiyuniar27-Apr-10 17:40 
AnswerRe: Which is the best way to set default value for properties Pin
Steven J Jowett27-Apr-10 21:13
Steven J Jowett27-Apr-10 21:13 
AnswerRe: Which is the best way to set default value for properties Pin
tosch27-Apr-10 21:25
tosch27-Apr-10 21:25 
GeneralRe: Which is the best way to set default value for properties Pin
andiyuniar27-Apr-10 22:03
andiyuniar27-Apr-10 22:03 
Answer[Solved] Which is the best way to set default value for properties Pin
andiyuniar27-Apr-10 22:47
andiyuniar27-Apr-10 22:47 
AnswerRe: Which is the best way to set default value for properties Pin
DaveAuld28-Apr-10 3:24
professionalDaveAuld28-Apr-10 3:24 
QuestionMultithread Error (Input string was not in the correct format)? [modified] Pin
Dominick Marciano27-Apr-10 13:49
professionalDominick Marciano27-Apr-10 13:49 
My program consist of a user interface and a separate class that handles the merging of data files. The class is called Merge and when it is done merging the data it raises the event MergeFinished. I declared the following delegates:

Dim WithEvents Merge As clsMerge     'Class that handles the merging of data
Delegate Sub MergeFinishedDelegate() 'MergeFinished Delegate
Private m_MergeFinishedDelegate As MergeFinishedDelegate


Now the sub that handles the MergeFinished event is as follows:

Private Sub MergeFinished() Handles Merge.MergeFinished

        If Me.InvokeRequired Then
            m_MergeFinishedDelegate = AddressOf Me.MergeFinished
            Me.Invoke(m_MergeFinishedDelegate)
        Else
            Me.Enabled = True
            Status.Text = "Merge Finished!"
            If Settings.AutoSwitch Then
                Dim newFrm As New frmGenerateReports
                newFrm.Show()
                newFrm.RecieveData(JBNArray)
                Me.Close()
            End If
        End If

    End Sub


However the Me.Invoke(m_MergeFinishedDelegate) has an error of "Input string was not in the correct format". This function has been working fine and now it doesn't. I haven't made any changes to this method so I don't know why it broke. Any suggestions?

EDIT: After stepping through the code, this is what I discovered. When the event is first raised, the IF part of the statement is run and the Me.Invoke code works fine. However, when the newFrm.Show() is called then the "Input string was not in the correct format" is thrown within the IDE. Why is the debugger jumping back to the IF part of the statement? And if I keep stepping through, it just loops (calls the invoke, goes the the ELSE statement, and once newFrm.Show() is called the "Input string was not..." is thrown again and the frmGenerateReports is never shown)

modified on Tuesday, April 27, 2010 8:04 PM

AnswerRe: Multithread Error (Input string was not in the correct format)? Pin
Luc Pattyn27-Apr-10 14:18
sitebuilderLuc Pattyn27-Apr-10 14:18 
QuestionHow to display access records in Visual Basic 2008 form? Pin
Razanust27-Apr-10 2:27
Razanust27-Apr-10 2:27 
AnswerRe: How to display access records in Visual Basic 2008 form? Pin
Dave Kreskowiak27-Apr-10 2:39
mveDave Kreskowiak27-Apr-10 2:39 
QuestionHow to avoid a group box using mixed with other group boxes while overlapping in VB 6 Pin
Razanust26-Apr-10 15:27
Razanust26-Apr-10 15:27 
AnswerRe: How to avoid a group box using mixed with other group boxes while overlapping in VB 6 Pin
DaveAuld26-Apr-10 23:21
professionalDaveAuld26-Apr-10 23:21 
Questionvisual basic simple calculator Pin
terrable26-Apr-10 11:17
terrable26-Apr-10 11:17 
AnswerRe: visual basic simple calculator Pin
Richard MacCutchan26-Apr-10 11:42
mveRichard MacCutchan26-Apr-10 11:42 
AnswerRe: visual basic simple calculator Pin
Luc Pattyn26-Apr-10 11:57
sitebuilderLuc Pattyn26-Apr-10 11:57 
AnswerRe: visual basic simple calculator Pin
Steven J Jowett26-Apr-10 21:38
Steven J Jowett26-Apr-10 21:38 
JokeRe: visual basic simple calculator Pin
Michel Godfroid27-Apr-10 1:21
Michel Godfroid27-Apr-10 1:21 
Questionmeaning of code Pin
skskhoukhita201026-Apr-10 5:25
skskhoukhita201026-Apr-10 5:25 
AnswerRe: meaning of code Pin
Michel Godfroid26-Apr-10 5:40
Michel Godfroid26-Apr-10 5:40 
GeneralRe: meaning of code Pin
Eddy Vluggen26-Apr-10 5:54
professionalEddy Vluggen26-Apr-10 5:54 
AnswerRe: meaning of code Pin
Eddy Vluggen26-Apr-10 5:50
professionalEddy Vluggen26-Apr-10 5:50 
GeneralRe: meaning of code Pin
skskhoukhita201026-Apr-10 6:04
skskhoukhita201026-Apr-10 6:04 
QuestionHow to sent Mail in VB6.0 Pin
JC.KaNNaN25-Apr-10 21:04
JC.KaNNaN25-Apr-10 21:04 
AnswerRe: How to sent Mail in VB6.0 Pin
Dalek Dave25-Apr-10 22:14
professionalDalek Dave25-Apr-10 22:14 

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.