Click here to Skip to main content
15,885,939 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: GET PC POSITION IN VISUAL BASIC Pin
Otekpo Emmanuel3-Jul-17 19:23
Otekpo Emmanuel3-Jul-17 19:23 
QuestionHow to return a array of structure in the function? Pin
Member 130177309-May-17 3:55
Member 130177309-May-17 3:55 
AnswerRe: How to return a array of structure in the function? Pin
David Mujica9-May-17 4:42
David Mujica9-May-17 4:42 
GeneralRe: How to return a array of structure in the function? Pin
Member 130177309-May-17 4:54
Member 130177309-May-17 4:54 
AnswerRe: How to return a array of structure in the function? Pin
Richard MacCutchan9-May-17 4:55
mveRichard MacCutchan9-May-17 4:55 
GeneralRe: How to return a array of structure in the function? Pin
Member 130177309-May-17 5:11
Member 130177309-May-17 5:11 
GeneralRe: How to return a array of structure in the function? Pin
Richard MacCutchan9-May-17 5:20
mveRichard MacCutchan9-May-17 5:20 
QuestionHow to dispose of a particular instance of a class? Pin
Sonhospa6-May-17 22:48
Sonhospa6-May-17 22:48 
Hello,

this might be a dummy question, but I couldn't find a good answer on the internet yet.

In my code I populate a CheckedListBox with the filenames of a particular filetype. If one of the entries gets checked ('ItemCheck' event of the CheckedListBox), I create an instance of a class that represents one of the relevant files.
If ctrl.GetItemCheckState(ctrl.SelectedIndex) = 0 Then
    ' create a new cfgFile class AND add it to the classes list
    ff = New cfgFile(ctrl.SelectedItem)
    lbl_FileMessage.Text &= ff.Message
Else
    ' How to dispose of the correct instance?
End if
How can I properly dispose of the correct classes' instance, once the item is unchecked again? I thought about looping through the instances and check for their 'filename' property... but there doesn't seem to be a collection of instances, which I can refer to in a loop.

Thank you for your advice,
Mick
AnswerRe: How to dispose of a particular instance of a class? Pin
Michael_Davies7-May-17 0:02
Michael_Davies7-May-17 0:02 
GeneralRe: How to dispose of a particular instance of a class? Pin
Sonhospa7-May-17 0:13
Sonhospa7-May-17 0:13 
AnswerProbable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Sonhospa7-May-17 1:00
Sonhospa7-May-17 1:00 
GeneralRe: Probable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Eddy Vluggen7-May-17 1:18
professionalEddy Vluggen7-May-17 1:18 
GeneralRe: Probable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Sonhospa7-May-17 1:37
Sonhospa7-May-17 1:37 
GeneralRe: Probable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Eddy Vluggen7-May-17 5:14
professionalEddy Vluggen7-May-17 5:14 
Questionvisual basic 6.0 winsock connect 3 client to play tetris game Pin
Member 131761035-May-17 19:27
Member 131761035-May-17 19:27 
AnswerRe: visual basic 6.0 winsock connect 3 client to play tetris game Pin
Richard MacCutchan5-May-17 21:14
mveRichard MacCutchan5-May-17 21:14 
QuestionDevelopment of Gmail integration Pin
Marzio Morandi4-May-17 6:19
Marzio Morandi4-May-17 6:19 
AnswerRe: Development of Gmail integration Pin
Richard MacCutchan4-May-17 6:30
mveRichard MacCutchan4-May-17 6:30 
AnswerRe: Development of Gmail integration Pin
Richard Deeming4-May-17 6:59
mveRichard Deeming4-May-17 6:59 
QuestionConvert .Wav File to Text Pin
Otekpo Emmanuel28-Apr-17 11:41
Otekpo Emmanuel28-Apr-17 11:41 
AnswerRe: Convert .Wav File to Text Pin
Dave Kreskowiak28-Apr-17 19:18
mveDave Kreskowiak28-Apr-17 19:18 
QuestionError to close form Pin
nei200920-Apr-17 16:11
nei200920-Apr-17 16:11 
AnswerRe: Error to close form Pin
Dave Kreskowiak20-Apr-17 17:18
mveDave Kreskowiak20-Apr-17 17:18 
AnswerRe: Error to close form Pin
Eddy Vluggen21-Apr-17 0:45
professionalEddy Vluggen21-Apr-17 0:45 
GeneralRe: Error to close form Pin
nei200921-Apr-17 7:24
nei200921-Apr-17 7:24 

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.