Output A Pyramid Of Asterisks Of Six Lines - 10 Times (vertically)
Oct 13, 2006
I have vb.net 2003. I have to output a pyramid of asterisks of six lines, 10 times (vertically). But the catch is that I have to use a loop. MsgBox("*" & vbCrLf & "* *" & vbCrLf & "* * *" & vbCrLf & "* * * *" & vbCrLf & "* * * * *" & vbCrLf & "* * * * * *") would give me one block of pyramid but how would I get a message box to display 10 of these at the same time? I'm pretty sure a nested loop would work but I've tried for hours and I can't get it to work.
It would look like this:
CODE:
View 5 Replies
ADVERTISEMENT
Feb 19, 2010
I have been tasked to build a simple application that has an input textfield, a button, and a large multiline textfield setup for displaying output> the user enters in the number of rows in the input textfield and presses the button> a pyramid made out of "O" should be created in the output textfield> for example: user enters 3 and presses the button> output in output textfield:
O
OO
OOO
OO
O
Here is the code I came up with so far:
Private Sub btndisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btndisplay.Click
Dim n As Long
Dim lngNum As Integer = CInt(txtinput.Text)
For n = 1 To lngNum
txtoutput.Text = "0" & vbCrLf
Next
End Sub
View 14 Replies
Feb 7, 2010
Im trying to change specific lines of text in a listview at certain times of the day. Heres what im using atm , but im not sure how to change the text in the listview.
If Now.Month = 2 And Now.Day > 6 Then
ListView1.Items(0) = ("My text here !!")
End If
View 9 Replies
Feb 17, 2011
Below is the code by which i should get the attached image, as shown in the attachment.Take a new form and name it as FormLemonbore and on this form add a picture box and name it as PctBrgSpecif Add the below lines of code in to the form
[Code]...
View 12 Replies
Nov 3, 2010
I'm trying to read a text file with multiple lines and then display it in a textbox. The problem is that my program only reads one line.
Imports System.IO
Imports Microsoft.VisualBasic.FileIO
Public Class Form1
[code]....
View 2 Replies
Nov 24, 2011
I try to redirect a robocopy job to a textbox. If I write the complete output after the job finishes, all is displayed correctly.
Code:
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.Arguments = "/C " & Chr(34) & cntCommand & Chr(34) & " && exit"
myProcess.EnableRaisingEvents = True
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
[code]....
View 5 Replies
Nov 7, 2010
My program has 2d array to find number of blocks in a certain level and total blocks of a pyramid. I need to also find the number of odd and even blocks.
Do I redim with different logic? O could I use the same population and make the specific button calculate for me. What is the logic?
Here's what I have:
Public
Class
Form1
[Code]....
View 1 Replies
Sep 30, 2010
As topic, how can I print the following output using For Loop and While Loop
1
22
333
Below is the output I get when I use For Loop
[Code]...
View 7 Replies
Jun 15, 2011
where I could find the code or construct it. I think its a lengthy code though.
View 6 Replies
Mar 30, 2012
i'm trying to create an asterisks triangle in a richtextbox. the design that i need is
---------*
--------**
-------***
[code]....
all the way down to 10 asterisk at the bottom and 9 spaces a 1 asterisks at the top. I'm a beginner to visual basic and coding in general.
The code that i have right now is:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Stars, Lines As Integer
[Code]....
View 6 Replies
Mar 14, 2010
INPUT FORMAT: The input consists of one or more lines or text input.
OUTPUT FORMAT: Each input message should be outputted enclosed in a frame of asterisks.
SAMPLE INPUT:
Hello there
There�s reason for every seasons�
A
Great
SAMPLE OUTPUT:
***************
* Hello there *
***************
[code]....
View 5 Replies
Feb 22, 2011
I'm making a hangman game right now, and the way it works is: It takes ten words from a text file and puts them in an array.It's supposed to take one of those words randomly and change all the letters to asterisks and display it in a text box for the user to start playing.I'm currently having trouble with converting the whole word into the right amount of asterisks to display.As you can see, I've already started trying something with a for next loop to go through the word and replace each letter with asterisks.But I'm not sure of the exact 'wording' of it.
View 1 Replies
Jun 21, 2010
I am having issues getting my application to display the correct number of asterisks per store. Also, I cannot figure out how to get each store to display in the list box.
' BarChart: Chapter 5 #6
' Program Discription: This application prompts the user to enter today's sales
' for five stores. The program then displays a bar graph comparing each store's
' sales. The bar graph is made up of asterisks in a list box. Each asterisk
' represents $100 in sales.
[Code].....
View 1 Replies
Oct 19, 2009
I'm currently taking a VB class as a complimentary in college, so keep in mind that I'm lowest of the low when it comes to this. For my assignment, using a console application, I need to create a pyramid of stars, such as this:
Enter number of stars: 3
***
**
*
So far, I've gotten to the point where it'll display enter number of stars: 3
3
2
1
How do I convert the numbers into the symbol?
View 14 Replies
Feb 26, 2009
'The program is supposed to create a Diamond Shape with the asterisks but I only get one-half of the 'diamond '(vertically) to appear.
Module Module1
Sub Main()
For i = 0 To 4
For j = 0 To 5 - i
Console.Write("")
[Code] .....
View 1 Replies
Dec 12, 2011
I want to enlarge an image, possibly up to 32 times or 64 times bigger than original dimensions (so that the user can see each pixel) if possible. The following is a simple function that I have to enlarge an image.
Private Function xEnlarge(ByVal Source As Image, ByVal Rate As Double, Optional ByVal Quality As Drawing2D.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic) As Image
[Code].....
View 6 Replies
Nov 20, 2010
filling datagridview vertically vb.netTommyTubes
View 1 Replies
Apr 19, 2010
Working with winforms I wonder if there is some way to prevent vertically resize of the form. I would like to allow user to resize form in all directions except vertically.Moreover I would like to allow vertically resize in upward direction, but not downward.
I have tried to use maximumsize by setting it to: Me.maximumsize = new size(0,me.height)
I set width to 0 because I want to allow user to change form width.
View 5 Replies
Mar 29, 2010
is there a way i can put a button instead of horizontal way, vertically?
not this:
PRESS THIS BUTTON
like this:
P
[Code].....
View 6 Replies
May 13, 2009
I have just started using vb.net and I have a checked list box with times throughout the day shown as
00:00 - 00:14
00:15 - 00:29
00:30 - 00:44
00:45 - 00:59
What I am trying to find is a way to get the current time and find which list item it fits into. What I think I need to do is to first of all get the current time and then go through the list splitting each item into 2 times and seeing if the current time fits. For example: Split the item 00:00 - 00:14 to 00:00 and 00:14 and then check if the current time is more than 00:00:00 but less than 00:14:59 and if so do certain task.how to go about taking each list item and splitting it into 2 separate times so I can check between them?
View 2 Replies
Oct 31, 2011
I'm drawing text in VB.net by using:
gfx.DrawString(_bText, New Font("Tahoma", 5), Brushes.Black, New Point(25, 5))
where gfx is a graphics object using my control. The x point is correct but I need the y to be the center of the current control (vertically).
View 3 Replies
Aug 15, 2011
listview1.items.add << it's is possible to declare a specific subitems vertically?
here's my sample
Dim item As ListView
Dim row As ListViewItem = Me.lstLicense.Items(0)
With row
lstLicense.subitems.Add(16).Text = (objDataReader("Division"))
End With
View 4 Replies
Apr 27, 2012
I have a dropdownlist that is bound from a separate dropdownlist selected value, on a second page. The number should read "563000" but instead when the list populates it reads.
View 1 Replies
Apr 17, 2009
I need to implement ruler bar(Horizontally and vertically) in vb.net windows application..
View 2 Replies
Dec 22, 2011
I have this code:
Code:
Private Sub DragDropListView_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If KeyItem Is Nothing Then
If tmrLVScroll.Enabled Then tmrLVScroll.Enabled = False
[code].....
but I can't get it to auto scroll vertically for largeicon, smallicon, and tile listviews.
View 5 Replies
May 10, 2010
I draw button vertically now i wanna set button text direction in vertically but there is no option.Is that possible ?
View 3 Replies
Mar 19, 2011
I have a dynamic gridview, about 35 rows by 11 columns. When the user hovers over a row, I highlight the row's background in green (with CSS:Hover). I would like to change the column's background as well, but I don't think I can assign css to a entire column. How can I accomplish this?
View 1 Replies
Apr 14, 2012
i have a menu strip that i docked on the left and i set the layout style to table so the dub menu items open below the selected menu item but i am wondering if i can make all my other menu items vertically shift so that i still can see them all. sort of like a sliding menu
View 3 Replies
May 25, 2011
i got a DataGridView with a various number of columns, depending on the user's selection.
My problem is that if I want to print the DataGridView, it does not fit on one page
How can the column header be printed vertically?
Has anyone an idea (or better) a code-snippet?
View 3 Replies
Feb 2, 2009
Is there a way to rotate a label such that it reads vertically? I've checked all of the label properties but there doesn't seem to be one that will do the trick.
View 1 Replies