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


ADVERTISEMENT

VS 2010 Randomizing - Program Randomly Choose Questions - NEVER Choose Same Question In Same Program

Dec 20, 2011

I am currently working on a family project which is based on "Who Wants To Be A Millionaire?" show. There is a huge diffrence between the show and my project. My project is a christmas edition and the goal is not to get money or something, since I will not add it... Erhmm... Let me get to the point. I have already designed a layout and scripted some things. I have about thirty questions but I do not want them to always spawn in the same array, if you know what I mean. I want the program to randomly choose one of those thirty questions and NEVER choose the same question in the same program run. By the way, there are four options on my project: A, B, C and D. I have got everything, I just need a code.

View 3 Replies

Display Dialog With List Of Web Colors For User To Choose?

Jun 5, 2011

How can I display a color dialog with a list of known web colors for the user to choose?
E.g.
black
white
dimgray
gray
darkgray
silver
etc.
I need to display ALL web colors

View 1 Replies

Choose Randomly From An Array?

May 19, 2011

I'm trying to configure my program to choose a random entry from an array:

Code:
MsgBox("Participants will now be allocated to each group at random...")
Dim number As Integer
Dim randomnumber As Integer

[Code].....

View 1 Replies

Randomly Choose An Image?

Apr 19, 2012

I am going to create a windows form and add a push button (pretty simple right?) I want the push button to randomly cycle through about 10 pictures and display the randomly selected picture.

A few problems I am facing, 1) I do not know how to do do "randomization" in VB.Net and 2) I do not know how VB.Net would handle displaying an image, would it display on the form i am building or would it display in the default photo viewer for Windows?

View 16 Replies

Randomly Choose Between The Two Phrases Not Keeping On Choosing The Same One?

Dec 21, 2010

i wanna make a program for my little brother, that allows u to input a name then to display a msgbox with pres coded phrases such as "your a good boy" or "your a bad boy". my problem is how do i tell vb to randomly choose between the two phrases, not keeping on choosing the same one?

View 14 Replies

VS 2010 Ftp - Promotion System Randomly Choose A Name (with Numbers And Letters - At Least 5)

Nov 17, 2010

This code raise the FTP server files

[Code]....

Now I want to know how to do the following:

1. Select a maximum size per file

2. Promotion system randomly choose a name (with numbers and letters - at least 5) Then the program will show me a link to a file after uploading (for example: [URL] in TextBox2.text)

View 6 Replies

Allow User Select The Sign Name From A Combo Box If User Choose?

Jan 18, 2011

Write an application that tests the user�s knowledge of road signs. The application should display a random sign image and ask the user to select the sign name from a Combobox.

View 12 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

Pop-Ups - User Can Choose If They Want The Pop-up Blocker On Or Off?

Nov 2, 2010

I made a pop-up blocker in my Visual Basic browser. Here is my code:

WebBrowser1_NewWindow

e.cancel = true

msgbox "Pop-Up Blocked!"

But how can I make it to where the user can choose if they want the pop-up blocker on or off? Also, how can I make it block pop-ups, but still open clicked links in a new window of my browser? Just curious.

View 9 Replies

Choose Any Item On A String List ?

Apr 3, 2011

How do i set a label text to display any of the declared string list randomly.

CODE:

View 4 Replies

Choose The Same Strings From Two List (Of String)?

Feb 24, 2012

I have two List(Of String).Both Lists contain duplicate strings. I want to pick out all the strings which are contained in both the Lists. For example:

List1 ={"10X100","10X100","10X100","50X100","50X100","100X100"}
List2 ={"10X100","10X100","20X100","50X100","50X100","100X100","200X100"}

So, the result should be: List3={"10X100","10X100","50X100","50X100","100X100"}.How to do this?

View 7 Replies

[2008] Choose Random Name On List?

Feb 7, 2009

I made a program to make a random name up from 2 textboxes on my program ( a firstname textbox and a lastname textbox). But the problem is that I'm just getting the names in order they were put in. I was using this code

Dim fname2 As String = fname.Lines(F)
Dim lname2 As String = lname.Lines(L)
and once it generated the name I would put

[code].....

View 5 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

User To Choose Save Name And Area?

Apr 7, 2011

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'Creates a string that holds the path to your file.
'this path uses the Special Dir .MyDocuments
'so on my computer LogPath = "C:UsersTechNoHickDocuments"
'on your computer LogPath might = "C:UsersKirbyDocuments"
Dim LogPath As String = String.Format("{0} est", My.Computer.FileSystem.SpecialDirectories.MyDocuments)
Dim FileName As String = "test.txt"

[Code]...

I am using visual basic 2010 express and would like to know how i can use a text box of sorts or windows explorer function to allow a user to save a file to a location of their choosing.At the moment a folder and .txt file is created in the mydocuments folder of the user's computer using this code

View 2 Replies

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

VS 2005 Which .Net Version Would Choose

Apr 26, 2010

I have a multi-threaded client and server application written in VS 2005. The server application runs thousands of SQL Server 2005 stored procedures and a lot of file IO. The client application does a lot of file searching, file IO, and string comparisons.Right now everything targets the 2.0 framework. Would it be advantageous to upgrade one or all 3 of them to the 2010 versions? I'm mostly interested in seeing speed enhancements. I haven't been able to find much saying 2010 is better than 2005.

View 2 Replies

Lets A User Browse And Choose A Folder?

Nov 8, 2011

Basically I need to make a program that lets a user browse and choose a folder, then I need a box that the user can then select the files to work with, then with the selected files I need to put them into a zip file. I'm trying to use a list view box but having all kinds of problems using the data in it.

View 2 Replies

Let The User Choose A Multiple Amount Of Car Parts?

Jul 10, 2011

i am currently developing a small basic program that will let the user choose a multiple amount of car parts and it will add it up and display a quote at the end.

View 7 Replies

Let The User Choose A Time With The Numeric Stepper?

Nov 12, 2010

I have an application that, when I finish it, will generate a graph of data drawn from a My SQL Database. It's going to be a simple time graph, with time on the bottom and a few stuff on the y axis.What I want is for the user to be able to enter the date. I would like it to be like a numeric stepper. Before I had two numeric steppers in the form but I decided one would be best.The idea was it would be like this: mm:hh [UP/DOWN ARROWS HERE]I saw one that was in use in an actual program. It had it so when you clicked the minutes, it selected the minutes and you could change them. The you could select the hours and change them. How would I do this?

View 2 Replies

MDI - Childforms - Application - User Can Choose Which Modul He Wants To Use

Oct 4, 2010

Here is a simplified hierarchy of a application I want to create:

1. Mainform - here should be a navigation pane, where a user can choose which modul he wants to use.

2. Childform Reports, Childform Maintenance, Childform To Do, Childform Management, ... - depending on which modul of the program the user wants to work with, a proper childform will appear as the main working part of the application

3. Childform CostReport, Childform TurnoverReport, Childform EmployeesReport, ... - if user wants to work with Childform Reports (chosen in 2. paragraph) he can work with one of these childforms.

I wanted to do this with MDI childforms, but visual basic keeps telling me that a form can be a MDI container only as a toplevel, which Childform Reports isn't. So i can make the program till 2nd paragraph but when i want to make the 3rd, its a problem.

I put the error here: "Top-level style of a parented control cannot be changed.

Parameter name: value"

Is there a workaround?

Maybe i could use TabControl for the 3rd paragraph, but its not that convient, since I want to use more "tabs" or forms...

View 9 Replies

Publish My App Where User Can Choose Location To Install It?

Aug 14, 2009

I am using VB Express 2008. Im jus't wondering is there any way I can publish my app where the user can choose the location to install it?

View 1 Replies

User Can Choose Excel Cells To Read

Oct 5, 2009

I want the people using my program to choose their own cell to read. I will have 2 textboxes (txtRow and txtColumn). They will have to click "read" to read from excel (but I will not open MS excel) and the answer will show in a message box. This is what I have done..

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click
Dim conn As New OleDbConnection("Data Source= D:LeeABC.xls ;Provider=Microsoft.ACE.OLEDB.12.0; Extended Properties=Excel 12.0;")
Dim da As New OleDbDataAdapter("Select * from [Sheet1$]", conn)
Dim dt As New DataTable
Dim Row1 As Single
Dim Column1 As Single
txtRow.Text = Row1
txtColumn.Text = Column1
da.Fill(dt)
MsgBox(mycell)
End Sub

View 2 Replies

VS 2005 How To Choose Random File

Aug 20, 2009

I need my code to be able to choose 5 random files from a folder. I was hoping I could instantiate the Scripting.FileSystemObject then grab the target folder as an object and do something like FolderObject.Files(12).Name but apparently that's not doable. What I did works, but is sloooow:

FS = CreateObject("Scripting.FileSystemObject")
Folder = FS.GetFolder("c: emp")
for y=1 to 5

[code]....

View 2 Replies

Brings Up A Form With Some Radio Buttons For User To Choose

Nov 20, 2009

I've written a program that brings up a form with some radio buttons for the user to choose.The form is setup by a sub in module1 (called Type2Q, shown below). For some reason, often radiobutton1 is checked when the question appears.I specifically set checked to false since I did not want this to happen. [code]

View 3 Replies

Allowing User To Choose Color For Form Background

Jul 31, 2009

How do I give the user a color chooser for the background of a form or anything else? I would like to be able to give him all colors in vb.net.

View 2 Replies

DialogBox - Enable User To Choose Folder Name And Save It

Jan 28, 2010

I want to have a dialog box like SaveFileDialog that will enable the user to choose a folder name and the save it. How I can achieve this?

View 5 Replies

How To Create A Browsefolderdialog - Popup To The User And Let Them Choose A Folder

Aug 19, 2010

I am going to show you how to create a browsefolderdialog. All this does it popup to the user and let them choose a folder.

For this you need:
1 Button
1 Textbox

Double click your button and add in the

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim BrowseFolder As New FolderBrowserDialog

[CODE]........

This sets your textbox1.text to what ever folder is selected. After that you can do whatever you want with your selected folder. This is how it will work when you are done: [URL]

View 3 Replies

Io - Allow User To Choose Directory To Save Multiple Files

May 26, 2012

I am needing to allow the user to choose a directory to save in. They can create a new directory if they want/need, and once they choose the directory, my program will save a few pre-coded files into that directory.

View 1 Replies







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