Click here to Skip to main content
15,887,434 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionAccess to the path 'Global\.net clr networking' is denied Pin
Anubhava Dimri11-Jul-09 0:44
Anubhava Dimri11-Jul-09 0:44 
AnswerRe: Access to the path 'Global\.net clr networking' is denied Pin
Christian Graus11-Jul-09 2:21
protectorChristian Graus11-Jul-09 2:21 
GeneralRe: Access to the path 'Global\.net clr networking' is denied Pin
Anubhava Dimri12-Jul-09 18:10
Anubhava Dimri12-Jul-09 18:10 
QuestionI want to click a link in the web page [modified] Pin
pobre1210-Jul-09 23:25
pobre1210-Jul-09 23:25 
Questionsomething like windows vista sidebar or google sidebar Pin
Ali Hojjati10-Jul-09 21:15
Ali Hojjati10-Jul-09 21:15 
AnswerRe: something like windows vista sidebar or google sidebar Pin
Henry Minute11-Jul-09 0:44
Henry Minute11-Jul-09 0:44 
QuestionCan't get combo box to update with data [modified] Pin
Dominick Marciano10-Jul-09 8:01
professionalDominick Marciano10-Jul-09 8:01 
AnswerRe: Can't get combo box to update with data Pin
Henry Minute10-Jul-09 10:45
Henry Minute10-Jul-09 10:45 
Two things occur to me.

1) at the beginning of ReLoadCustoms() you go through the StructureFile file and add each item to an ArrayList. If you run your application with a dummy StructureFile containing say 2 to 3 items, then add 1 new item, it would be relatively painless to use the debugger to watch the items being added to the list. Once you are sure that they are there you can move on to dealing with the ComboBox. Before that though you should consider using a List (Of Component) instead of an ArrayList. Look it up in the MSDN Documentation under Generics.

Also where you create the FileStream and the StreamReader, consider using a Using block. This will ensure that they are both closed and disposed properly without you having to worry about it. Something like this:
 Dim div() As String

 Using fs As New FileStream(AppPath & "\" & StructureFile, FileMode.Open, FileAccess.Read, FileShare.None)

  'Clear Component Array
  ComponentArray.Clear()

  'Check if the file is empty
  If Not fs.Length = 0 Then
    'Create a new stream reader
    Using Reader As New StreamReader(fs)

      'Read each line of the file until the end of the file
      Do Until Reader.EndOfStream
        'Split each line delimited with '='
        '(Structure=Member1,Member2,...,MemberN)
        div = Reader.ReadLine.Split("=")
        CurrentComponent.ComponentStructure = div(0)
        CurrentComponent.ComponentMember = div(1)
        'Save the component in the 'ComponentArray' array list
        ComponentArray.Add(CurrentComponent)
      Loop
    'Close the stream reader
    End Using
  End If
End Using


Again look up Using in MSDN. In the MSDN Index look-up Using Statement you will see two sub items, have a read of them. It is far safer.

2) Instead of going through your ArrayList (List (Of Component)) adding items to the Combo.Items one at a time, why not use DataBinding to bind the list to the ComboBox.DataSource. It will save you having to do all that clearing and adding. Take a look at ComboBox DataBinding Sample[^]

Please come back if I have not been clear.

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

QuestionRe: Can't get combo box to update with data Pin
Dominick Marciano16-Jul-09 7:18
professionalDominick Marciano16-Jul-09 7:18 
AnswerRe: Can't get combo box to update with data Pin
Henry Minute17-Jul-09 0:03
Henry Minute17-Jul-09 0:03 
QuestionPrinting in .net Pin
No-e10-Jul-09 7:55
No-e10-Jul-09 7:55 
AnswerRe: Printing in .net Pin
Henry Minute10-Jul-09 11:16
Henry Minute10-Jul-09 11:16 
GeneralRe: Printing in .net Pin
No-e10-Jul-09 11:45
No-e10-Jul-09 11:45 
QuestionFind a 16bit Process Pin
nlarson1110-Jul-09 4:01
nlarson1110-Jul-09 4:01 
AnswerRe: Find a 16bit Process Pin
Dave Kreskowiak10-Jul-09 9:47
mveDave Kreskowiak10-Jul-09 9:47 
GeneralRe: Find a 16bit Process Pin
nlarson1110-Jul-09 9:55
nlarson1110-Jul-09 9:55 
QuestionGoogle Earth in Web Application with adress search capabilities Pin
Member 442053410-Jul-09 3:38
Member 442053410-Jul-09 3:38 
AnswerRe: Google Earth in Web Application with adress search capabilities Pin
DoctorMick10-Jul-09 4:55
DoctorMick10-Jul-09 4:55 
AnswerRe: Google Earth in Web Application with adress search capabilities Pin
DoctorMick10-Jul-09 5:03
DoctorMick10-Jul-09 5:03 
QuestionHow to convert number to indian rupees format text in crystal report??? Pin
JC.KaNNaN9-Jul-09 21:25
JC.KaNNaN9-Jul-09 21:25 
AnswerRe: How to convert number to indian rupees format text in crystal report??? Pin
Nagy Vilmos9-Jul-09 21:58
professionalNagy Vilmos9-Jul-09 21:58 
GeneralRe: How to convert number to indian rupees format text in crystal report??? Pin
JC.KaNNaN9-Jul-09 22:15
JC.KaNNaN9-Jul-09 22:15 
GeneralRe: How to convert number to indian rupees format text in crystal report??? Pin
Nagy Vilmos10-Jul-09 1:03
professionalNagy Vilmos10-Jul-09 1:03 
QuestionMoves data From Program Files in VISTA Pin
Anubhava Dimri9-Jul-09 21:14
Anubhava Dimri9-Jul-09 21:14 
AnswerRe: Moves data From Program Files in VISTA Pin
Dave Kreskowiak10-Jul-09 3:11
mveDave Kreskowiak10-Jul-09 3:11 

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.