Click here to Skip to main content
15,921,646 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Large size of Excel files Pin
DaveAuld6-Nov-09 10:16
professionalDaveAuld6-Nov-09 10:16 
GeneralRe: Large size of Excel files Pin
Saurabh_Damle6-Nov-09 20:42
Saurabh_Damle6-Nov-09 20:42 
GeneralRe: Large size of Excel files Pin
DaveAuld6-Nov-09 21:17
professionalDaveAuld6-Nov-09 21:17 
QuestionUpdate entries in Database Column. Pin
jeshra2796-Nov-09 0:50
jeshra2796-Nov-09 0:50 
QuestionPublish application in start-->program list Pin
vijay24826-Nov-09 0:08
vijay24826-Nov-09 0:08 
QuestionLabel Array HELP Pin
PAguilar095-Nov-09 18:20
PAguilar095-Nov-09 18:20 
AnswerRe: Label Array HELP Pin
Christian Graus5-Nov-09 18:57
protectorChristian Graus5-Nov-09 18:57 
AnswerRe: Label Array HELP Pin
dan!sh 5-Nov-09 21:35
professional dan!sh 5-Nov-09 21:35 
PAguilar09 wrote:
For i = 0 To StrArr.Length - 1 lblDis1.Text = StrArr(0) 'gets the first value from the array lblDis2.Text = StrArr(1) 'gets the second value from the array lblDis3.Text = StrArr(2) ' and so on and so on........... lblDis4.Text = StrArr(3) lblDis5.Text = StrArr(4) Next


PAguilar09 wrote:
For count = 0 To StrArr.Length - 1 'add user entered values to list box lstDisplay.Items.Add(StrArr(count)) Next


1. Why are you displaying same thing twice in the UI? Even if you need to, why not have a single loop instead of two.

2. How did you decided the number of labels when at design time you don't know how many will be required?
3. Why do you bother to set count as 0 after the loop? I don't see you using it anymore. Declare that inside for loop itself.
4. Why do you need variable Str when you can directly split the textbox text?
5. In the second loop, you are not using "i" anywhere.


For adding text to the listbox, I would use following code (c#):

listBox.Items.AddRange(this.textBox1.Text.Split(new char[1] { ' ' }));


It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

GeneralRe: Label Array HELP Pin
PAguilar095-Nov-09 22:42
PAguilar095-Nov-09 22:42 
GeneralRe: Label Array HELP Pin
The Man from U.N.C.L.E.5-Nov-09 22:51
The Man from U.N.C.L.E.5-Nov-09 22:51 
GeneralRe: Label Array HELP Pin
PAguilar095-Nov-09 23:03
PAguilar095-Nov-09 23:03 
GeneralRe: Label Array HELP Pin
Sigurd Johansen6-Nov-09 10:18
Sigurd Johansen6-Nov-09 10:18 
GeneralRe: Label Array HELP Pin
PAguilar096-Nov-09 19:23
PAguilar096-Nov-09 19:23 
GeneralRe: Label Array HELP Pin
Sigurd Johansen7-Nov-09 7:23
Sigurd Johansen7-Nov-09 7:23 
GeneralRe: Label Array HELP Pin
PAguilar097-Nov-09 15:45
PAguilar097-Nov-09 15:45 
GeneralRe: Label Array HELP Pin
DaveAuld6-Nov-09 21:30
professionalDaveAuld6-Nov-09 21:30 
QuestionOutlook Contact Picture Path Problem Pin
dcdhingra5-Nov-09 18:15
dcdhingra5-Nov-09 18:15 
QuestionHelp with Modules-specifically subprocedures Pin
bphoopstar5-Nov-09 18:12
bphoopstar5-Nov-09 18:12 
AnswerRe: Help with Modules-specifically subprocedures Pin
Christian Graus5-Nov-09 19:00
protectorChristian Graus5-Nov-09 19:00 
Questionhow to read data from store procuder in dataset ? Pin
Pitou HORT5-Nov-09 16:41
Pitou HORT5-Nov-09 16:41 
AnswerRe: how to read data from store procuder in dataset ? Pin
Christian Graus5-Nov-09 19:01
protectorChristian Graus5-Nov-09 19:01 
GeneralRe: how to read data from store procuder in dataset ? Pin
Pitou HORT5-Nov-09 19:46
Pitou HORT5-Nov-09 19:46 
GeneralRe: how to read data from store procuder in dataset ? Pin
Christian Graus5-Nov-09 20:16
protectorChristian Graus5-Nov-09 20:16 
GeneralRe: how to read data from store procuder in dataset ? Pin
Pitou HORT5-Nov-09 21:01
Pitou HORT5-Nov-09 21:01 
Questionappend menustrip items Pin
ivo755-Nov-09 7:51
ivo755-Nov-09 7:51 

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.