doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
Go Back  Xtreme Visual Basic Talk > > > doing pretty good so far... {place buttons randomly}


Reply
 
Thread Tools Display Modes
  #21  
Old 09-27-2004, 08:16 PM
Iceplug's Avatar
Iceplugdoing pretty good so far... {place buttons randomly} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default


Started on what? Setting up the array? Putting the characters into the buttons?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #22  
Old 09-27-2004, 08:31 PM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Default

the array...I think I'm ok with the buttons
Reply With Quote
  #23  
Old 09-27-2004, 08:55 PM
Iceplug's Avatar
Iceplugdoing pretty good so far... {place buttons randomly} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

To create an array filled with three letter words you can do this:

Dim Stuff() As String = {"Ark", "Beg", "Cop", "Day", "Far", "Gap", "Hug", "Job", "Key", "Lip"}

The first element "Ark" is located at Stuff(0)
The last element "Lip" is at Stuff(9)

Stuff(5) will yield "Gap".

If you wanted a random element from this array, you would do something like this:
X = Ri.Next(10) '<-- One of ten numbers from 0 to 9.
Stuff(X)
will be a random three-letter word from the array.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #24  
Old 09-27-2004, 10:33 PM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Thumbs up

sweet.....works like a champ! Of course you know I'm going to have
other questions, should I start another post?

thanks for all your help Ice!!!!
this is looking nice...here's the code....


Code:
    'Random number generator
    Dim Ri As Random = New Random()
    Dim X As Integer = Ri.Next(6)
    'the Array for the words
    Dim strTheWord() As String = _
        {"DOG", "CAT", "GUM", "TOE", "SUN", "COW", "HAT"}
    'placeholder for each letter
    Dim A As Char
    Dim B As Char
    Dim C As Char
    Dim D As Char 'just in case

    Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PictureBox1.Visible = False
        Dim strSpllWrd As String
        strSpllWrd = strTheWord(X)

        'this breaks the word into ind. letters
        A = strSpllWrd.Chars(0)
        B = strSpllWrd.Chars(1)
        C = strSpllWrd.Chars(2)
        
        Button1.Top = 24
        Button1.Left = 136
        Button1.Text = A
        Button2.Top = 24
        Button2.Left = 256
        Button2.Text = B
        Button3.Top = 24
        Button3.Left = 16
        Button3.Text = C
Reply With Quote
  #25  
Old 09-28-2004, 09:39 AM
Iceplug's Avatar
Iceplugdoing pretty good so far... {place buttons randomly} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

You have seven elements in your array, which means the call to Ri.Next should have a 7 instead of a 6.
Otherwise, you'll never see "HAT" as a word.
Quote:
Dim D As Char 'just in case
Heheheh.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #26  
Old 09-28-2004, 10:21 AM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Default

Quote:
Originally Posted by Iceplug
You have seven elements in your array, which means the call to Ri.Next should have a 7 instead of a 6.
Otherwise, you'll never see "HAT" as a word.
Heheheh.

aahhh....ok, I thought it started at 0....
I really do have other questions, should I start them in another post?
or because it's all related to this one project, should it stay here?

A.
Reply With Quote
  #27  
Old 09-28-2004, 07:39 PM
Iceplug's Avatar
Iceplugdoing pretty good so far... {place buttons randomly} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

It doesn't matter, but since it is closely related to this thread, you should probably just keep it here.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #28  
Old 09-28-2004, 09:42 PM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Default

ok, help me see what I'm doing wrong here, because it's not working:

Code:
    Private Sub Showpic()
            If strTheWord Is "DOG" Then
            PictureBox1.Image = Image.FromFile _
            (System.Environment.GetFolderPath _
            (Environment.CurrentDirectory) _
    & "\images\dog2.gif")
End If
End Sub
I have the images dir in my BIN folder, is this where it belongs? & I tried
\images and just images w/o the \, no luck (just in case you ask, yes, dog2.gif is in \bin\images folder ).
Right now, the Properties for Picturebox1 is set to nothing.
Does it have to be set to something?
Reply With Quote
  #29  
Old 09-29-2004, 09:39 AM
Iceplug's Avatar
Iceplugdoing pretty good so far... {place buttons randomly} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

You should only use Is for checking if two objects are referring to the same thing.

For strings, you can just do =. As in
If str = "DOG" Then
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #30  
Old 09-29-2004, 12:53 PM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Default

see, that's what I thought too, but VS said that was a no-no.
and it finally didn't error out when I put IF blah IS "blah" THEN...

I'll try it again tho

A.
Reply With Quote
  #31  
Old 09-29-2004, 03:45 PM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Default

another thing I just thought of
if in the program it breaks down the the word into individual characters
would I have to "reassemble" (I think it's string.concatenate)
to have the program understand = "DOG"

just something I thought while I'm waiting for 5 o'clock

A.
Reply With Quote
  #32  
Old 09-29-2004, 11:02 PM
Iceplug's Avatar
Iceplugdoing pretty good so far... {place buttons randomly} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

The word should still be in strTheWord, unless you declared strTheWord in the subroutine instead of on the form's declarations.
But, yes, you can concatenate the characters together using String.Concat or you can use the & operator to concatenate.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #33  
Old 10-02-2004, 11:19 AM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Thumbs up

alright!! got it working....thanks a ton for your help Ice!!!
anyone know where I can go over a good toolbar tutorial?

A.
Reply With Quote
  #34  
Old 10-02-2004, 09:18 PM
Iceplug's Avatar
Iceplugdoing pretty good so far... {place buttons randomly} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Not really.
I would just add one to the form and start experimenting and/or looking it over in MSDN.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #35  
Old 10-03-2004, 09:10 AM
mj0lnr mj0lnr is offline
Newcomer
 
Join Date: Sep 2004
Location: San Antonio, TX
Posts: 22
Default

yea, that's kind of what I was doing....again, thanks for your help Ice...

A.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly} doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
 
doing pretty good so far... {place buttons randomly}
doing pretty good so far... {place buttons randomly}
 
-->