Use Variable Instead Of Numbers In Label1.show()?
Mar 29, 2010Is it possible to use variables instead of the numbers in Label1.show() command?
For example: Label(counter).show()?
Is it possible to use variables instead of the numbers in Label1.show() command?
For example: Label(counter).show()?
I have 2 forms on the first form i have a label with a number in it.When i click a button on the first form this label changes and i also want to change the text property of a label on another form that may or may not be visible.Why does:Form2.Label1.Text = me.Label1.text Not work?
View 15 RepliesI'm taking VB at the college right now and we are studying Select Case Statements. What I need to do is type in a number in a text box and make it equal into a label so when i press my button the numbers I type in the text box appear in their letter forms. Here is my code so far:
lblNumber.Text = ""
Dim intA As Integer = CInt(txtBox.Text)
Select Case intA
[Code]....
I got it to work with the smaller numbers, I just don't know how I would make it so that if I type in a big number it would show all the numbers instead of just one.
For this assigment i need to show the numbers from 1 to 10 then 10 to 1 then the even numbers from 2 to 20 then the even numbers from 20 to 2 My problem is that it works fine till it gets to the even numbers. It won't exit the 2nd loop so it gets stucked in the 10-9-8-7... It all has to be in one button.
[Code]...
i dont really think its that hard to make, but i dont find out how.
I want "label" to change if label1 is "anything" label1.text"random"
i Want the label to go like lyrics, it changes all the time.
I'm adding a downloaded file size counter to my program and I want it to add to the variable filesize whenever a certain item is checked and the code I thought would work isnt.[code]...
View 11 Repliesi have this code:
For i As Integer = 0 To 9
For ii As Integer = 0 To 9
For iii As Integer = 0 To 9
[Code]...
it must find all numbers that are faculty between 0 to 999
What do I use for the format number function to show a - for negative numbers instead of ()?
View 2 RepliesI need to format a Label to show numbers in a certain way. I had asked this before about textboxes so I looked into that first but it didn't do what I wanted.
[Code]...
Write a program that asks a quiz show contestant to select one of the numbers 1,2, or 3 and then calls a Sub procedure that asks the question having that number and requests the answer. The Sub procedure should then call another Sub procedure to tell the contestant if the answer is correct. Use the following questions:1. Who was the only living artist to have his work displayed in the Grand Gallery of the Louvre?2. Who said, "Computers are useless. They can only give you answers."?3. By what name is Pablo Blasio better known?This is what I have so far (with errors):
[Code]...
I have a problem which is that Class Big integer Doing a miscalculation
For example: -
5 / 2 = 2.5
With Class
5 / 2 = 2
I want to do to show the numbers after the decimal point (.5)
I want to know the codes to show numbers one by one continuously from 1 to 20 on clicking a button, and it should keep on doing it till a Button is clicked.I know how to get a Random number to for it but I don't know how to do for numbers in normal order .
View 11 RepliesIm trying to do a lab that will obtain 10 numbers from the user using an InputBox() function, store them internally in a one-dimensional array, and then compute the average of the numbers and sort them in reverse numerical order. The program should control that 10 numbers (no more, no less) are entered, and that the numbers are fully validated as integers.
If the user enters non-numeric data, then an appropriate error message should be shown, and that number should be allowed to be re-entered as a valid number. Then all the numbers should be shown as a list in a 'message box'. So far I can get everything but the message box to show the list of numbers entered.
[Code]...
I have three Buttons labled "Single" "Double" and "Triple" and four textboxes, one for each button and one to display the results. Here is how it works. Each time I click on one of the buttons, it increments itself by that number...for example if I click on Button with the word "Triple" on it I will get the result '3' in the adjoining textbox. If I click it again the number will change to '6'. This holds true for all the buttons. I have this part of the program working well. there a way to have the addition of all these numbers appear in the fourth textbox WITHOUT having to use another button. In other words I want the fourth textbox to constantly update as I'm pushing buttons.
View 2 RepliesWhen put in ComboBox a number,and click on button Find, I want the DataGridView to show all the numbers that are smaller than the one I put in Combobox
View 5 Replieswith the code to my form on week numbers. below is what i have on my form code at the monent. and where the text in green is
View 11 RepliesI want to generate serial nos while i insert records in sql database like 1,2,3,4,5,6[code]...
View 5 RepliesBasically what I am making is a form with just one button and 2 text boxes. The purpose of it is that when I click the button 2 random PRIME numbers between 100-999 will show up in the boxes. With my code I have now, the numbers that show up in the boxes aren't always Prime.
My current Code is.......
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Randomize()
Dim p, q, i, j As Integer
[Code] .....
I know how to declare a variable, a function, to write a string of characters or numbers (I still looking in tutorials and depict from there what i need to know) but...WHAT I DONT KNOW is how to USE them? At "what" or "how" are you thinking when you make a program? I try for SOME LOooNG TIME to understand but I think im too stupid to understand from pages on the net (or i dont find THAT tutorial who can explain right for me).I try a lot of programing languages starting with pascal,c,c++,darkbasic,alice, Visual-c,c#,c++,basic,php,even assembler, some programing zones in Excel and Word but from all of this i cant manage to understand the life behind the words.
View 1 RepliesI need a variable divider ex. i have numbers from my textboxes in the range of 20 to 60 i want a divider that will divide them in a range of 2 to 6 so if the number is the lowest 20 the divider will divide him with the lowest of his range number 2 if the number is 40 the divider will divide him with the number 4 if the number will be 45 the divider will divide 4,5 and so on a variable divider.
View 21 RepliesI need to figure out how to add a picture to label1 , add 2 to textbox11.text i once A is selected from listbox1 cant seem to find it?
View 7 Repliesi have a bunch of labels in my application that when clicked should change color if the label is transparent (Color detirmend by function):[code]The problem is that it takes 2 to 3 clicks before it works the first time, after that it works fine when clicked.Is the function to big? (it really needs to be!)
View 6 Replieslets say i have a label with $50 in it. How do i subtract 10% from the $50 in label1?
I Though it would be label1.text -= 1% but apprently not
I have created a program that saves the co-ordinates of the users mouse and saves it to a text file to be used as an auto clicker.
View 2 RepliesI have a code that can generate from letter a to z
here it is
Private Sub GenerateRandomNumbers()
Dim randomObjectName As New Random
randomObjectName.Next(97, 122)
[Code]....
The problem is I'm expecting that the output will be the dim of the letter.
for example the random generated letter is 'a' the output in label1 will be "hi?"
I got how to get a webste source and set the value to label1.text but the problem is that the code searches for the word and removes everything before that word and everything after ">" (ex id=word word = "2332"> I can remove everything before the first word and everything after >) but my problem is that I cant remove the " because I have to close it like " " and then my label1.text is 1" or 13". So is there a way to remove the " from the label?
View 2 RepliesI have DATASET1
and Tableadapter1 in datasetq.
In my TableAdapter1 i have a query
SELECT column1
FROM table
WHERE (ID = @Param1)
My question.how can i get the record from SQL with parameter and dispayed into Label1 I want to send for example value 1 for the parameter and i want to display in label1 the returned result from query This is my code started
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ta As New DataSet1TableAdapters.tableTableAdapter
Label1.Text = ????????
End Sub
I use visual basic 2008, I use Groupbox1, In the Groupbox1 in have two labels: label1 and label2. I have change the font of label1 with properties to size 12, No i change the font size of Groupbox1 with properties to size 8, Only label2 inherit font (8) format from GroupBox1 and label1 inherit not font change. I want that label1 and label2 inherit font from GroupBox1, always! I how can i do this?
View 1 RepliesIf I pass Label1.Text through a function it treats it as an object and not a string. Which is good.
But when I do something like:
Dim temp As Object = Label1.Text
And then pass it through a function it treats it as a string, which is to be expected. How can I make it so I can set Label1.Text to an object the same way it would if I just passed it through a function.
Edit: Here is specifically what I want to do
Public Sub test()
setIt(Label1.Text, "Test") 'this works
Dim temp As Object = Label1.Text
[Code].....
allow label1 to stay on the form when i close it or load it?
View 10 Replies