Click here to Skip to main content
15,560,618 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: GET PC POSITION IN VISUAL BASIC Pin
Otekpo Emmanuel3-Jul-17 20:23
Otekpo Emmanuel3-Jul-17 20:23 
QuestionHow to return a array of structure in the function? Pin
Member 130177309-May-17 4:55
Member 130177309-May-17 4:55 
AnswerRe: How to return a array of structure in the function? Pin
David Mujica9-May-17 5:42
David Mujica9-May-17 5:42 
GeneralRe: How to return a array of structure in the function? Pin
Member 130177309-May-17 5:54
Member 130177309-May-17 5:54 
AnswerRe: How to return a array of structure in the function? Pin
Richard MacCutchan9-May-17 5:55
mveRichard MacCutchan9-May-17 5:55 
GeneralRe: How to return a array of structure in the function? Pin
Member 130177309-May-17 6:11
Member 130177309-May-17 6:11 
GeneralRe: How to return a array of structure in the function? Pin
Richard MacCutchan9-May-17 6:20
mveRichard MacCutchan9-May-17 6:20 
QuestionHow to dispose of a particular instance of a class? Pin
Sonhospa6-May-17 23:48
Sonhospa6-May-17 23: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 1:02
Michael_Davies7-May-17 1:02 
GeneralRe: How to dispose of a particular instance of a class? Pin
Sonhospa7-May-17 1:13
Sonhospa7-May-17 1:13 
AnswerProbable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Sonhospa7-May-17 2:00
Sonhospa7-May-17 2:00 
GeneralRe: Probable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Eddy Vluggen7-May-17 2:18
professionalEddy Vluggen7-May-17 2:18 
GeneralRe: Probable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Sonhospa7-May-17 2:37
Sonhospa7-May-17 2:37 
GeneralRe: Probable Solution Or Workaround (Re: How to dispose of a particular instance of a class?) Pin
Eddy Vluggen7-May-17 6:14
professionalEddy Vluggen7-May-17 6:14 
Questionvisual basic 6.0 winsock connect 3 client to play tetris game Pin
Member 131761035-May-17 20:27
Member 131761035-May-17 20:27 
AnswerRe: visual basic 6.0 winsock connect 3 client to play tetris game Pin
Richard MacCutchan5-May-17 22:14
mveRichard MacCutchan5-May-17 22:14 
QuestionDevelopment of Gmail integration Pin
Marzio Morandi4-May-17 7:19
Marzio Morandi4-May-17 7:19 
AnswerRe: Development of Gmail integration Pin
Richard MacCutchan4-May-17 7:30
mveRichard MacCutchan4-May-17 7:30 
AnswerRe: Development of Gmail integration Pin
Richard Deeming4-May-17 7:59
mveRichard Deeming4-May-17 7:59 
QuestionConvert .Wav File to Text Pin
Otekpo Emmanuel28-Apr-17 12:41
Otekpo Emmanuel28-Apr-17 12:41 
AnswerRe: Convert .Wav File to Text Pin
Dave Kreskowiak28-Apr-17 20:18
mveDave Kreskowiak28-Apr-17 20:18 
QuestionError to close form Pin
nei200920-Apr-17 17:11
nei200920-Apr-17 17:11 
AnswerRe: Error to close form Pin
Dave Kreskowiak20-Apr-17 18:18
mveDave Kreskowiak20-Apr-17 18:18 
AnswerRe: Error to close form Pin
Eddy Vluggen21-Apr-17 1:45
professionalEddy Vluggen21-Apr-17 1:45 
GeneralRe: Error to close form Pin
nei200921-Apr-17 8:24
nei200921-Apr-17 8: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.