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
ADVERTISEMENT
Jun 17, 2011
I am new in visual basic and I came up with a problem. I have text file with names in it and I want in a textbox everytime the user hits a button randomly choose a name from it.
View 1 Replies
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
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
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
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
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
Mar 30, 2010
I have created a resume parser which as it stands now, opens word documents and parses the content for specific tokens. It also converts the doc into html format but my problem involves natural language processing. I was told to use the SharpNLP in order to recognize specific phrases, these are typically of the type:
[Code]...
View 4 Replies
Mar 19, 2010
I'm using the code below to take a string and split it up into an array. It will take: Disney Land and make it two separate elements. If the string contains "Disney Land" then it is one element in the array. Works great, however it adds some empty elements to the array each time. So I just iterate over the elements and remove them if they are empty. Is there a tweak to the code below that will prevent those empty elements from occurring?
Private m_Reg As Regex
m_Reg = New Regex("([^""^s]+)s*|""([^""]+)""s*")
Dim rezsplit = m_Reg.Split(criteria)
View 2 Replies
Jun 22, 2010
I am wanting to take a string of say the following:
Guiness Harp "Holy Moses"
So that in C# or VB get a match set of:
Guiness
Harp
Holy Moses
Essentially it splits on the spaces unless there are quotes around the spaces, then those words between quotes are considered a single phrase.
View 4 Replies
Feb 24, 2009
i wanted to link options selected from Comb box A (general) to specific options in combo box B (specific). I want to pick a word in Combo box A that has specific words/phrases in Combo Box B show. But not all the words to show in the combo box B if they aren't associated with the Word picked in Combo Box A. Ex.When "Soda" is picked in A, only "Coke, Sprite, Fanta" should be visible in combo box b, not everything else.This is the code i used to make the boxes, but i don't know how to link them.
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' fills the combo boxes with values
Me.xGeneralComboBox.Items.Add("Soda")
Me.xGeneralComboBox.Items.Add("Juice")
[code]....
View 7 Replies
Aug 10, 2009
So I have this project for my internship at this company that is just screaming to be done with a script, but I don't know how to. I was given about 5,000 files to deal with. They are TRC files but can be opened in notepad to appear as follows:
[Code]...
View 4 Replies
Nov 17, 2010
how to get different backcolors and how to change them using ListView.ItemCheck.
I am using ListView in a self written control (basically to improve padding). In some deployments, CheckBoxes is set to true and I use a RaiseEvent to return the Index of the row selected using an ListView_SelectedIndexChanged event.
In other deployments, I am using the control with the CheckBoxes set to false. But clicking on a row does not fire the ListView_SelectedIndexChanged event to be able to use RaiseEvent to return the Index of the row chosen. I have tried using a MouseUp event to capture the mouse Y coordinate. But conversion of that coordinate to an Index position is both inconsistent and inaccurate with my primative code of
return = (point.Y - me.top) / some constant
I have used ItemHeight on a ListBox in a similar situation but ListView does not have an ItemHeight property.
how I can capture the Index of a row clicked in a ListView without checkboxes?
View 8 Replies
Feb 18, 2010
I would like to know if there is a command to make a program choose between certain integers. For example, I would like my program to make a random choice between the numbers 12, 118,224 and 300.
View 1 Replies
Aug 4, 2009
In previous I have great experience on Vb 6.0 And Now I am getting train on Vb.Net. But some well adviser saying you should study C# instead of Vb.Net. In this case I don't know which language I should study.
View 9 Replies
May 14, 2009
What I wanna do is really simple, I just want to select 2 Listboxed by clicking one..For example .. if I select the 1st item of listbox1, it should select automaticly the 1st item of listbox2 if I select the 3rd item of listbox1, it should select 3rd item of listbox2, and so on, is this possible?
View 2 Replies
Jun 21, 2010
choosing a combo box event for placing this code. I have tried with ostfocus,leave,mousefocuschanged,displaymemberchanged like this but nothing works and Lable26(Default I set Visible:false ) is visible even after I select an Item.
If combotype.SelectedIndex = -1 Then
Label26.Visible = True
Label26.ForeColor = Color.Red
[code]......
View 5 Replies
Mar 5, 2012
I am using Printdialog control in VB 10 but I am not able to choose de printer. Even choosing a specific printer in the Printdialog, it always prints in the default printer of the computer.
View 5 Replies
Jan 8, 2012
I am trying to figure what is the best way of using SQL in my app in the manner of run time.I need to select data from my database let say 60 times a day maybe more I can use the dataset and its adapters or use the SqlCeCommand to build my own Q What do you recommend?
View 2 Replies
Apr 1, 2011
I am writing a .NET program which will run on a computer with several IP addresses. The program makes HTTP requests to given web addresses. I want to choose which IP address I use (so I can determine which IP address will appear on the log of the other server).
View 1 Replies
Jan 27, 2011
I have 9 numbers 1,2,3,4,5,6,7,8,9. I want different combinations of 5 numbers out of 9 numbers (no repeat of same numbers in a row). E.g. 1,2,3,4,5 - correct, 1,1,2,3,4 - wrong
I want no duplication either
E.g.:
1,2,3,4,5
1,2,3,5,4
Any formula which works for 8 or 9 or 10 or n numbers. I know there is 126 ways C(9,5)=(9!)/(4!.5!)=...=126 ways. I need the code to generate unique set numbers
E.g.:
1,2,3,4,5
1,2,3,4,6
2,3,4,5,6
View 1 Replies
Jul 21, 2010
It is may be not so important, but very interesting to know why when in programm use SaveFileDialog.ShowDialog() I can't delete selected path?
don't help even: SaveFileDialog.Dispose()
View 4 Replies
Mar 21, 2009
I am making a program to enter random phrases and words into an object on a web browser. I am not sure how to make the program choose a random phrase or word though.Basically I need to have a list of 100 or more words and phrases inside a program, and for the program to choose one when called upon.
View 3 Replies
Dec 12, 2009
I'm working with a connection to a Access db. I noticed that when the mdb file is not found in the location it should be, an exception OleDbException is thrown. I would like to create some kind of form where the user specify the new position of the Access mdb file to continue to work. Then, it would be useful to save the new location as well I suppose. But, where do I have to handle that exception?
View 6 Replies
Apr 27, 2010
I have a VB.NET application with a connection to an SQL Server 2003. On the server there are two databases, MyDatabase and MyDatabase_Test. What I would like to do is to show a dialog when the program starts that let's the user choose which database to use. My idea is to create a new form as the starup form that sets this property and then launches the main form.Currently the connectionstring is specified in the application config file. Best would be if I can specify two different connection strings in that file to choose from, but for now it is also acceptable with other solutions like hardcoding the two connectionstrings into the startup form.EDIT: In the dataset.xsd file there seems to be the relevant part
<Connections>
<Connection AppSettingsObjectName="MySettings" AppSettingsPropertyName="MyDatabase_ConnectionString" ConnectionStringObject="" I
[code]....
View 3 Replies
Jun 21, 2010
I am making a simple unit converter, and wanted the user to specify the number of decimal places to be displayed for the results.
The user selects which conversion they want to perform from another combo box, and I have a select case to decide the calculation needed. Eg.
Select Case cboUnitType.SelectedIndex
Case 0 'grams to ounces
lcUnit2 = lcUnit1 * CSng(0.00220462262)
[Code].....
View 4 Replies
Jun 27, 2011
I have a listbox with file names in them, I want to be able to view the contents of those files by using a textbox on the side
Code I tried below:
Dim data As String
data = My.Computer.FileSystem.ReadAllText(ListBox1.SelectedItem)
TextBox1.Text = data
View 7 Replies
Feb 7, 2011
I have an app with a webbrowser, and I want to navigate from one webpage to another by selecting and submitting a value in a selectbox on the page. How do I do this? The selectbox on the website has a bunch of strings (my program knows which string to choose), and I want it to automatically submit the correct value.
View 5 Replies
Nov 17, 2010
I have a program issue I am trying to work on. I have multiple comboboxes(12 total) on a form.I am attempting to update some settings from what ever the user selects from the combo boxes. I am trying to keep the code as small as possible, so I thought about having all the comboboxes have similar names only different by a number being changed at the end. (ex: cbo_1, cbo_2, cbo_3, etc...)And using a For next loop to advance through each combobox and update the settings as the for next loop advances.(This might be a stupid way of doing it, but its the first idea that came to mind.)
[code]...
View 1 Replies
Jul 8, 2009
I'm trying to design a windows form application. By default, .NET had put Tahome 8,25 on toolbar and Microsoft SansSerif 8,25 on everything else. To improve general look and feel of the forms I'd like to change them.
Which font family should I use as a default? And what size should they be?
For:
Classic data input form (label + textbox, label + combobox...)
Data grid
Is there any recommended way?
Application is a classic business app, you can think of it as an accounting type.
View 2 Replies