Create An Application That Will Randomly Select 14 "stations" (strings) From A List Of 33?

Mar 3, 2012

I am trying to create an application that will randomly select 14 "stations" (strings) from a list of 33. My thinking is that I have a for/next loop that randomly selects a number between 1,33 which is then inputted into an array (arrnumber) I then want those random numbers to then be used to call the Station name which is saved in the second array, and then for the selected stations to be populated into a listbox (potentially by storing those names selected in a new array?)

Various people have suggested either using a list (of t) instead of arrays, or a Dictionary(?) or perhaps even a database, though I am not all that confident with VB to be able to know where the best place to start with that is. So if anyone can offer any advice, pointers as to how I can link my 2 arrays (I am pretty sure I know how to make the array populate a listbox) I would be very much obliged.

Public Class Form1
Dim Stationid() As String = {"Cardiovascular Examination", "Respiratory Examination", "Abdominal Examination", "Abdominal Examination with Stoma", "Groin and External Genitalia Examination", "Cranial Nerves Examination", "Arm Examination", "Leg Examination", "Parkinson`s Examination", "Cerebellar Examination", "Speech Examination", "Hand Examination", "Elbow Examination", "Shoulder

[code].....

View 5 Replies


ADVERTISEMENT

Create A List Box Of 25 Randomly Generated 0s Or 1s - When Put The Loop In, It Only Repeats The Same Random Number?

Mar 25, 2012

Beginning VB 2010, had a project that requires us to create a list box of 25 randomly generated 0s or 1s. Problem is when I put the loop in, it only repeats the same random number, not different one each loop. What am I doing wrong?This is the code I have so far...Code in Question:

'Declare new random object
Dim RandomGenerator As New Random
intRandomNumber = RandomGenerator.Next(0, 2)[code]......

View 4 Replies

Use .next (random Numbers) To Randomly Select Something From A List Of Numbers But It Can't Repeat The Number?

Aug 16, 2009

So how would I use .next (random numbers) to randomly select something from a list of numbers but it can't repeat the number?I could do:

dim num as integer
dim r as new random
num = r.next(1,5)
if num = 1 then
elseif num = 2 then
etc.

That wouldn't work because it would repeat.If I donwload someone's game can I disect it in VS? :0 I tried going to open project, then I went to the folder and clicked open. It brought me inside of the folder so I tried to open the game but there is no form1 there. It says the games name then .exe in the explorer-like thing in the top right?Also, how would I have a value or something in a label and access it from a button.

Example:This is in a label.

Dim number as Integer
number = 0

Then in the button do

Label.number = 0

How would I do something like that? I want to use that a lot as I did in a different language.

View 6 Replies

VB 2010 Create List Of Strings?

Oct 23, 2011

I'm new in this forum, and I'm a very very very basic user of the VB. How can I create a list of strings? I'm trying to make a chat with a robot. I put 2 labels. And my code is:

Dim mylist As New List(Of String)
mylist = "hello", "bye"
If Not Label1.Text = mylist Then

[code].....

View 2 Replies

Way To Concatenate List Of Strings Into A Comma-separated Strings, Where Strings Are Members Of An Object?

Oct 16, 2009

Say I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?

View 2 Replies

Create A List Of Strings With Integer Appended

Jun 6, 2011

What would be the easiest way for me to create a list of words with a sequential number appended to the string. I need the string and amount of numbers to be a variable. For example:

network1
network2
network3
network4

[Code].....

View 2 Replies

Randomly Call Strings From Array

Nov 25, 2010

I am writing a who wants to be a millionaire console application in VB and need to write the 50/50 bit. I have tried searching for a solution but i couldn't find anything that would solve my problem. The questions and answers are stored in an array and i need to be able to call a random answer from the array.

View 3 Replies

VS 2008 Randomly Display Strings?

Mar 27, 2009

Basically what i want to do is when a command button is clicked and it has run the code at then end i want a label to display one string out of many at random. How would i declare the various strings and then get it to display one at radnom

View 7 Replies

Ruby Re-create Such List (as An Array) With Such Elements (they Will Be Strings, Booleans And Integers)?

Apr 4, 2011

How would I create a list of elements in VB.NET, save it to a .dat file, and make Ruby re-create such list (as an array) with such elements (they will be strings, booleans and integers)?

View 2 Replies

Create A Form That Accepts Names (or Any Strings) As Input And Stores Them In A List Object?

Oct 6, 2010

I'm trying to create a form that accepts names (or any strings) as input and stores them in a object. See attached form sample.Form Image:

Operations: ï Initially the NumericUpDown object on the form should be disabled.The user enters a value (string) in the textbox and clicks the Add button or presses the Enter key to activate that button.The application then stores that name in a List object, and displays the last entry in the Label underneath.The NumericUpDown should become enable after the first entry. The user should be able to move between all the values entered using NumericUpDown.

View 7 Replies

Randomly Select From A Group?

Jun 9, 2011

I am interested in making a program to randomly populate gym-exercises from a group of them that I will populate. For instance, I want to be able to check "triceps," and then have "triceps kickback" pop up from a larger group of exercises, and the next time I click it another triceps exercise will pop up.

View 14 Replies

Randomly Select An Item From A Combobox

Nov 19, 2009

How would I randomly select an item from a combobox

View 1 Replies

VS 2008 Randomly Select 1 String

May 17, 2010

How do I randomly select 1 string from some Text? For example: Main text:

[Code]....

View 5 Replies

Select Items Of An External Application List?

Jan 5, 2011

By the EnumChildWindows API I can know the Hwnd of the ListBox control of an external application. By the Hwnd I can too to select "generically" the control by a PostMessage API, also if the application is not the foreground window.

Now the question is: is there way, in your opinion, to select a specific item of this external list box, also when the application is not the foreground window?

View 3 Replies

Randomly Select 3 Items To Display On A Page

Jun 15, 2010

I have a class and I am trying to randomly select 3 items to display on a page (each item should be unique so that there is no repeating).I have some code that works(ish). The problem is that when I track the random numbers it takes about at least 50 attempts for the application to select a different random number than the one that was chosen the first time (defying the laws of probability).[code]

View 3 Replies

Randomly Select Items In Combobox1 When Click It?

Aug 2, 2011

I have a button called 'populate'. I need it to randomly select items in combobox1 when I click it. Here is what I have tried doing but it doesn't give me the desired results.

Dim sacostofsyscheckout As Integer
Randomize()
sacostofsyscheckout = CInt(CInt((1500000 * Rnd()) + 3000000))

[Code]......

View 6 Replies

Randomly Select Which Graphic To Display On My Form?

Apr 26, 2010

Right so I have made a graphic of a coin being flipped. Heads is shown on one graphic, tails on the other. I wanna set it up so that when I hit go it will randomly play one of the two graphics on one of my forms.How easy is it to add a .gif file to a form that can play when told to? What is the code im looking for to help with me with what I'm trying to do?

Another thing I plan to achieve is also a random number generator that will display a number on a ball that rolls on to the screen. So the displaying of a number will be timed to show up when the ball comes in focus. I have some code that I have used previously to generate a number, but I wanna get the generated number to show in time with the ball rolling up.What are some wait commands to use in vb .net? This is the code I am using to randomly generate a number.

vb

Dim r As New Random
TextBox1.Text = r.Next(0, 150)

View 1 Replies

VS 2008 Randomly Select DataTable Row And Get Data?

Dec 19, 2009

The next step is I need to build a randomizer to randomly select a row and read the columns of that row into varibles.I have a working randomizer that can randomly pick a number between min and max values but what I don't know if how to select a row / How to find out how many rows are available and how to read the values into varibles.Am I right in declaring an Integer Varible then using:

AvailableRows = DDT.Rows.Count

Then use my Random Function to pick a number between 0 and AvailableRows

View 8 Replies

Randomly Select The Questions W/ Answer In Database(mysql)?

Aug 28, 2011

I'm started my project and here is my code.

con.Close()
con.Open()
com.CommandText = "SELECT * from math.questions where number ORDER by rand() limit 1"

[code].....

View 1 Replies

Create A Program Which Will Allow Users To Select Multiple Files From A List And Then Burn Them All To A Playable DVD?

Oct 24, 2011

I am trying to create a program which will allow users to select multiple files from a list and then burn them all to a playable DVD. It would be wonderful if i could setup a custom menu programatically as well. I have seen some documentation on Imapi 2.0 but i have not been able to find too much suppoert for it. I have also found a few SDK's out there but most are over $1000 which just isnt in the budget.

1) Is there a library included in windows 7 that will allow me to do this.

2) Is there an inexpensive or open source sdk with good documentation out there to do this with

View 4 Replies

Prepend A String To All Strings In A List Of Strings?

Aug 5, 2010

I have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.

Here is the method I wrote:

Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))

[code].....

It works, but I would rather use built in functions whenever possible.

View 5 Replies

VS 2008 Using List Of Strings Or Array Of Strings?

Oct 16, 2009

I'm migrating from VB6 to VB.NET, in hence my questions below:

I have to write a function that returns array of strings.

How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.

Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?

View 3 Replies

Pick Randomly From A List?

Jul 12, 2011

I want to pick some uniq numbers from a list of numbers randomly list of numbers:

dim firstlist() = [1,2,3,6,7,9,12,16]

I want to pick some uniq numbers randomly from this list [2,6,16]

View 2 Replies

Using Randomly Generated Numbers From List Only Once

Mar 16, 2011

Below is a form which produces a graph, the idea is to produce 6 random numbers from a range (0,6) place the numbers in an array then use these numbers to produce columns on the graph, however at the moment it is using the numbers more than once, how can I get it to just use the values once only in the array.

Private Sub btnGraph_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGraph.Click
txtAns.Text = ""
g.Clear(Me.BackColor)
g.DrawLine(Pens.Black, 50, 70, 50, 420)
[Code] .....

View 7 Replies

Create An Application For A Kiosk Where A Customer Could Select Pictures From A Camera?

Jan 19, 2012

I need to create an application for a kiosk where a customer could select pictures from a camera, select and edit the pictures, then submit them for order. Are there any really strong image editor controls I could use or you can recommend?

View 10 Replies

VS 2005 Choose Randomly From User List?

May 18, 2010

I'm relearning VB.net just for fun, so consider me new at this. I'm trying to write a program where the user can input a list of names or numbers, and the program will randomly pick one of those names or numbers. So far, I can get it to randomly generate numbers based on what I put in the code, but I don't know what I should use for the user to input the data, and how to code it so that the program will pick from that data.

View 3 Replies

Create Windows Application Installation / Setup Select Component Window?

Jun 30, 2010

I am creating a windows application setup project using Visual studio 2008 setup project. This setup will have following steps[code]...

View 1 Replies

Forms :: Get A Button To Enter The Applications Subfolder And Randomly Select 1 File To Be Played In The Windows Media Player

Oct 19, 2010

I need to get a button to enter the applications subfolder and randomly select 1 file to be played in the windows media player COM which i have put in the form. I have tried creating a shuffling playlist but i cant get it to stop after one file is played (it just goes on shuffeling to another file, and i really do not want a playlist). I manage to create a batch file to be started to randomly pick a file in that folder, but when i do this the file is being played in the systems default player..

View 2 Replies

Change The Background Randomly From A Selected List After A Certain Amount Of Time?

Jan 16, 2009

I am trying to change the background randomly from a selected list after a certain amount of time. I have the array set-up and I have it picking a random path (ex c:images est.jpg). I found in the registry the background image settings. I tried setting the registry key to the path but it seems like there is more to it than that because it doesn't change it. I also saw where it stored the file and tried changing it but again it doesn't change it. The funny thing is if I go to display properties afterwards it shows the correct image just doesnt set it. If I then click a different image and go back to it then it sets it. How can I make it update the background?

View 5 Replies

C# - Deploying A .Net App Source Control (SVN) Over 32-bit AND 64-bit Dev Stations?

Jan 13, 2011

Our Dev Team has heterogeneous OS systems, scattered between 32-bit and 64-bit. This is not ideal, we are actually planning to homogenize our infrastructure, but in the meantime we have to deal with it.The issue is that when a 32-bit developer checks out a 64-bit solution on SVN, he has to manually change the target platforms all over again to get it compiled (not to mention other side problems)

My question is : What clean (though temporary) solution could be addressed in such situation, permitting each developer to keep his default project/platform settings while checking out and in from SVN.I guess that -at least for the first time a project/solution is checked out, a dev still has to tweak the setting manually to compile it properly. After that, according to relevant SVN filters, it is possible to ignore some settings files (which ones, by the way?)

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved