User Profile
Collapse
-
as a matter of fact, i don't know how to interrupt the code and always wondered how to do it... -
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 codeCode:Public Class Form1 Dim x As Integer() = New
Leave a comment:
-
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 tryCode:For index = 0 To 5 Do While index <= 5
Leave a comment:
-
Thanks a lot killer42
This is what I came up with, 2 attempts
The firstCode: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)
Leave a comment:
-
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
Leave a comment:
-
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
Leave a comment:
-
-
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 onLeave a comment:
-
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...Leave a comment:
-
-
i more confused now as i can see Label1, if i hover over it i get the same error message...Leave a comment:
-
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...Leave a comment:
-
i've been trying to set up a string array and assign the contents to each of the labels as needed with the codeCode:Dim y As String() = New String() {} Label1.Text="y(0)"
Leave a comment:
-
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
thanksLeave a comment:
-
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 toCode:doDim y As CaptionButton() = New CaptionButton() {} label1.text="y(0)"
Leave a comment:
-
I've been able to achieve what i wanted with the codeCode: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
Leave a comment:
-
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 codeCode: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) {}
Leave a comment:
-
-
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()
-
No activity results to display
Show More
Leave a comment: