User Profile

Collapse

Profile Sidebar

Collapse
Modibbo
Modibbo
Last Activity: May 24 '07, 07:45 PM
Joined: Apr 23 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Modibbo
    replied to random number selection and display
    as a matter of fact, i don't know how to interrupt the code and always wondered how to do it...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    Thanks a lot killer42, i really appreciated it.
    Here's my code now, which is not too bad, with help i must acknowledge.
    Now the very last bit, i want to check the answers with the if...then...els e statement at the end of the program, but i don't know, it its always running the else part, it is in all cases displaying the incorrect message on the red background here's my final code
    Code:
     Public Class Form1
        Dim x As Integer() = New
    ...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    i'm running out of ideas, i know i need a condition after the while (what would it be, that i'm not sure), anyway, i've turned around the loop in so many positions (do...., loop until; do while.....loop, for.....next); i even don't get why do we need this loop in a loop (the outer loop for....next)
    all i know is i need a push now
    thanks
    this is one of my try
    Code:
    For index = 0 To 5
                Do While index <= 5
    ...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    Thanks a lot killer42
    This is what I came up with, 2 attempts
    The first
    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim index As Integer, randomgenerator As New Random, computerchoice As Integer
            For index = 0 To 5
                Do While computerchoice = randomgenerator.Next(0, 19)
                    If computerchoice <> x(index)
    ...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    nearly there!
    i know as killer42 made the remark, it's not the best code but as long as it's working i'll try and improve it when finished, not to forget i've been programming only 2 months, enjoying it though.
    now the last bit, after sorting the array with Array.Sort, all of the 6 buttons display always 0
    here's my full code
    Code:
    Class Form1
        Dim x As Integer() = New Integer(20) {}
    
        Private Sub
    ...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    i've been able to display the Nos in the labels in order of theclick of the buttons
    now i want to sort the Nos and display the sorted values in the buttons (from 2 to 6) in order to arrage them in ascending order
    here's my code
    Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Dim NoOfElements As Integer, I As Integer, J As Integer, Temp As Integer
    ...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    any suggestion, any hint, thanks...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    guys, how would i go about choosing between the buttons, for the 1st clicked store its content in the 1st label, the 2d button to the 2nd label, so on.
    my problem is th choose between the first button which is clicked , whichever is this first, it can be the button in the line to be clicked first, or the last one in the line, it doesn't matter, the 1st clicked, its value assigned to 1st label, and so on
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    hands up sammyB, i've just realised what i did was starting a new line after ending the precedind sub, so VB was telling me hang on you did not declare the new sub you're starting; a proof of how confused i am with this program, still struggling though with it, gonna be there, never give up...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    the error message is...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    i more confused now as i can see Label1, if i hover over it i get the same error message...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    unless if i don't get you, but i did not delete Label1 as i'm telling you the wigly line is on Label1, so it has to be there to have the wigly line on it...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    i've been trying to set up a string array and assign the contents to each of the labels as needed with the code
    Code:
     Dim y As String() = New String() {}
    
    Label1.Text="y(0)"
    and getting the error message with a wigly line on Label1...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    thanks once more again for helping, as i was saying i don't have any clue as to how to start, would it be possible to give an example of code please
    thanks
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    i've been thinking (may be wrongly & sorry about that incase) there might be a way to set up an array of captions and assign them to the labels and i've been trying hard, but again i have no clue
    any help pleasethis what i've been trying to
    Code:
    doDim y As CaptionButton() = New CaptionButton() {}
    
    label1.text="y(0)"
    label2.text=y(1 )and i'm getting the error message at both the last 2 lines of the code (where i'm...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    I've been able to achieve what i wanted with the code
    Code:
    Dim x As Integer() = New Integer(10) {}
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            Dim m_blnUsed As Boolean() = _
            New Boolean(x.GetUpperBound(0)) {}
    
    
            Dim objrandom As Random = New Random()
            Dim intrandom As Integer
    ...
    See more | Go to post
    Last edited by Modibbo; May 4 '07, 07:16 PM. Reason: correction

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    thanks a lot sammyB, killer42 for all your help; i've been going trough all the material you've suggested, even some of it i read before by searching, but still can't get my head round it. nevertheless still trying, here's the modified code
    Code:
    Public Class Form1
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim x As Integer() = New Integer(6) {}
    ...
    See more | Go to post

    Leave a comment:


  • Modibbo
    replied to random number selection and display
    forgot to mention I'm using VB2005
    See more | Go to post

    Leave a comment:


  • Modibbo
    started a topic random number selection and display

    random number selection and display

    Hi there,

    I'd like to submit this program I'm working on to thr forum.
    I want to display 6 randomly generated numbers on 6 command buttons as captions at the click of another button. One number will be selected only once.
    Here's my code:
    Code:
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim x As Integer() = New Integer()
    ...
    See more | Go to post

  • Modibbo
    replied to random image selection in VB
    thanks a lot killer42, i'm done now...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...