Click here to Skip to main content
16,014,392 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Tracking NewsTicker Pin
LloydA11129-May-10 12:31
LloydA11129-May-10 12:31 
QuestionThanks for prior help- next problem- array/collection or class to store/save data Pin
lemarshall27-May-10 14:26
lemarshall27-May-10 14:26 
AnswerRe: Thanks for prior help- next problem- array/collection or class to store/save data Pin
Andy_L_J28-May-10 8:41
Andy_L_J28-May-10 8:41 
GeneralRe: Thanks for prior help- next problem- array/collection or class to store/save data Pin
lemarshall2-Jun-10 16:36
lemarshall2-Jun-10 16:36 
QuestionCreating label array in vb.net 2007 Pin
lemarshall27-May-10 5:24
lemarshall27-May-10 5:24 
AnswerRe: Creating label array in vb.net 2007 Pin
Luc Pattyn27-May-10 5:39
sitebuilderLuc Pattyn27-May-10 5:39 
GeneralRe: Creating label array in vb.net 2007 Pin
lemarshall27-May-10 6:37
lemarshall27-May-10 6:37 
GeneralRe: Creating label array in vb.net 2007 Pin
Luc Pattyn27-May-10 7:46
sitebuilderLuc Pattyn27-May-10 7:46 
From the MSDN documentation on ArrayList.ToArray(Type) it is clear an ArgumentNullException will be thrown when the type is Nothing. So here are two ways to get that, assuming controlType starts at Nothing:

1. the if fails in line 43
2. getControlFromName in line 47 return Nothing for any of a million reasons (maybe controlName does not contain what you hope for)

I must say your code snippet (lines 43-56) is a bit bizarre; either you expect to find a single control, then why would you need an ArrayList? or you expect multiple controls, but then the last one decides on the type of all of them?? This could work fine under your current conditions, I can't tell, it doesn't look very robust. And, as stated before, there may be zero matches, resulting in line 56 causing an Exception.


FWIW: I advise you start each VB file with "Option Strict On". It will cause some pain as now the system complains a lot, but it will force you to improve your code and in the end save lots of debugging time.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

AnswerRe: Creating label array in vb.net 2007 [modified] Pin
William Winner27-May-10 8:21
William Winner27-May-10 8:21 
GeneralRe: Creating label array in vb.net 2007 Pin
lemarshall27-May-10 9:50
lemarshall27-May-10 9:50 
GeneralRe: Creating label array in vb.net 2007 Pin
William Winner27-May-10 10:42
William Winner27-May-10 10:42 
Questionvisual basic 2008 captcha to picture box help Pin
Snipe7627-May-10 2:43
Snipe7627-May-10 2:43 
AnswerRe: visual basic 2008 captcha to picture box help Pin
Henry Minute27-May-10 4:37
Henry Minute27-May-10 4:37 
Question[Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 2:06
fenindom27-May-10 2:06 
AnswerRe: [Need Correction]Class To Load sqlReader into Listview Pin
Tom Deketelaere27-May-10 2:34
professionalTom Deketelaere27-May-10 2:34 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 3:04
fenindom27-May-10 3:04 
AnswerRe: [Need Correction]Class To Load sqlReader into Listview Pin
William Winner27-May-10 8:30
William Winner27-May-10 8:30 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 9:19
fenindom27-May-10 9:19 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
William Winner27-May-10 9:23
William Winner27-May-10 9:23 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 9:27
fenindom27-May-10 9:27 
QuestionProcedure and code for adding a plug-in for Outlook. Pin
S.Srinivasa Rao26-May-10 23:18
S.Srinivasa Rao26-May-10 23:18 
AnswerRe: Procedure and code for adding a plug-in for Outlook. Pin
Dalek Dave26-May-10 23:52
professionalDalek Dave26-May-10 23:52 
AnswerRe: Procedure and code for adding a plug-in for Outlook. Pin
Tom Deketelaere27-May-10 2:37
professionalTom Deketelaere27-May-10 2:37 
AnswerRe: Procedure and code for adding a plug-in for Outlook. Pin
Eddy Vluggen28-May-10 1:56
professionalEddy Vluggen28-May-10 1:56 
GeneralRe: Procedure and code for adding a plug-in for Outlook. Pin
Luc Pattyn28-May-10 2:38
sitebuilderLuc Pattyn28-May-10 2:38 

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.