.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old May 4th, 2008, 04:10 PM
karl1 karl1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 15 karl1 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 8 m 23 sec
Reputation Power: 0
Various issues with arrays

First of all, I need to read an array of strings into a label at a time, and display the label. For some reason, the labels don't display.


Code:
    Sub CreateGoldLabels()
        Dim ArrayOfBucks(Box_no) As String
        ArrayOfBucks(0) = "£0.01"
        ArrayOfBucks(1) = "£0.10"
        ArrayOfBucks(2) = "£0.50"
        ArrayOfBucks(3) = "£1"
        ArrayOfBucks(4) = "£5"
        ArrayOfBucks(5) = "£10"
        ArrayOfBucks(6) = "£50"
        ArrayOfBucks(7) = "£100"
        ArrayOfBucks(8) = "£250"
        ArrayOfBucks(9) = "£500"
        ArrayOfBucks(10) = "£750"
        ArrayOfBucks(11) = "£1,000"
        ArrayOfBucks(12) = "£3,000"
        ArrayOfBucks(13) = "£5,000"
        ArrayOfBucks(14) = "£10,000"
        ArrayOfBucks(15) = "£15,000"
        ArrayOfBucks(16) = "£20,000"
        ArrayOfBucks(17) = "£35,000"
        ArrayOfBucks(18) = "£50,000"
        ArrayOfBucks(19) = "£75,000"
        ArrayOfBucks(20) = "£100,000"
        ArrayOfBucks(21) = "£250,000"
        Dim X, Y, k, counter As Integer      '4 variables
        X = 56                                       'coordinates XY
        Y = 24
        counter = 0
        For k = 0 To (Box_no - 1) ' box_no = 22
            counter += 1
            Glabel(counter) = New Label
            Glabel(counter).Size = New Size(56, 24)
            Glabel(counter).Location = New Point(X, Y)
            Glabel(counter).BackColor = Color.Silver
            Glabel(counter).Text = ArrayOfBucks(k)
            Glabel(counter).Visible = True
            Glabel(counter).Enabled = True
            Y += 32
            If counter = (Box_no / 2) Then
                X = 472
            End If

        Next
    End Sub


Also, I want to read the array into a label randomly. So after I've read them into the labels consecutively 1-22, I want to read them into a seperate set of labels at random. I know the codes a bit dodgy, and you can write arrays quicker than that, but I really don't care, it's some lame project I have to do.

Reply With Quote
  #2  
Old May 5th, 2008, 01:58 AM
Shefeer's Avatar
Shefeer Shefeer is offline
DEVILS IN RED
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Location: Kerala, India
Posts: 144 Shefeer User rank is Private First Class (20 - 50 Reputation Level)Shefeer User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 3 h 2 m 29 sec
Reputation Power: 4
Send a message via MSN to Shefeer Send a message via Yahoo to Shefeer
For the label to be displayed, you have to add the control to a container (eg. a Form). For example you have to do something like this

Form1.Controls.Add(Glabel(x))

Try this, you ll get your label displayed
__________________
Ahmed Shefeer

Manchester United

English Premier League 2007, 2008 Champions

Reply With Quote
  #3  
Old May 5th, 2008, 03:28 AM
karl1 karl1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 15 karl1 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 8 m 23 sec
Reputation Power: 0
Any idea how to randomly get numbers from the array into some label.text's??


A man u supporter too.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Various issues with arrays


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway