I'm trying to create a message box that shows a column for Years, represented by 0-10, and an amount, as a $ wise decimal in another column.
I was wondering how to create a multi column message box with column headings o.o.
Thanks!
Printable View
I'm trying to create a message box that shows a column for Years, represented by 0-10, and an amount, as a $ wise decimal in another column.
I was wondering how to create a multi column message box with column headings o.o.
Thanks!
Are you really talking about a Message Box ... or some sort of List Box with columns?
Sounds like a ListView in Report View or a Grid control to me.
Yeah it says that it will show the data in a message box, with two columns, one for year and one for amount on deposit.
You'll need to create a form with the list view or grid on it... there isn't a way to use the built-in MessageBox...
-tg
http://www.vbforums.com/attachment.p...id=47243&stc=1
The attached is a form that looks like a MsgBox. Just add a litview control to it and you'll have what you want. If you don't need the "don't show this again" code then remove it.
I don't think were allowed to use another form though, and I can't open those files, I'm using microsoft visual studio 2008?
The whole assignment is to calculate interest over 10 years, and have it display the totals for all 10 years in a message box. With one column with years 1-10, and the other column with the totals for each corresponding year. Is there anyway to do this with a list box? I'm using for next loop.
I got the calculation part to work but I dont know how to get the message box to look like hers does...
You need to post in a VB.Net forum. This one is for traditional Visual Basic.
Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
Do I have to use some sort of array? But the message box has to have "Years" and "Amount on deposit" as the column headings, followed by the 1-10 under "Years', and a Decimal Amount under "Amount on deposit". I'm so clueless
you can create columns in a msgbox, you need to use a system font (one where the letter W will take the same space as a letter I) and you need to fill each field with spaces to a fixed amount then you can do something like
so you create an array with 2 dimensions and 10 elementsCode:Year | Amount
2000 |$1234.56
2001 |$5643.21
2002 |$2222.22
[code]
Dim Deposits(10,1) As String
[code]
then you need to fill the values for the array( not forgetting the header in (0,0) and (0,1), then use a loop and add spaces to make the columns the size (in chars) you need. once you have done this you create a string using a loop like this
Finally you display this string in the msgboxCode:Dim FinalString as String = ""
for a = 0 to 10
FinalString &= deposits(a,0) & "|" & Deposits(a,1) & VbCrLf
Next a
Hope this helps ;)Code:MsgBox(FinalString)
And how do you control the font used by the msgBox?
Isn't that controlled by the system?
-tg
After messing around for the past 2 hours i came up with this.....seems way to complicated but it works...>_>
Is there any easier way to do this? lmaooo -_-
nice, forgot about the Tab :) and good you used environment.newline rather than vbcrlf which is the preferred .net way of doing a newline.
Ok now I have some seriously wierd problem. No matter what I change on the program, when I run it, it appears and runs as if I did nothing. I can delete all of the lines of code for the each year button press, and save it and run it, and it still works perfectly...
Like I can literally delete all of the code, save it, and run it and it will still run perfectly fine....*** -_-
Which is making it impossible for me to create the code for the every three years button, considering no matter what the changes I make in the code don't seem to reflect anything when I run it...
any ideas?
you can replace
withCode:InformationString = "Year" & ControlChars.Tab & "Amount on deposit" & Environment.NewLine _
& YearsInteger(1).ToString("N0") & ControlChars.Tab & AmountDecimal(1).ToString("C") & Environment.NewLine _
& YearsInteger(2).ToString("N0") & ControlChars.Tab & AmountDecimal(2).ToString("C") & Environment.NewLine _
& YearsInteger(3).ToString("N0") & ControlChars.Tab & AmountDecimal(3).ToString("C") & Environment.NewLine _
& YearsInteger(4).ToString("N0") & ControlChars.Tab & AmountDecimal(4).ToString("C") & Environment.NewLine _
& YearsInteger(5).ToString("N0") & ControlChars.Tab & AmountDecimal(5).ToString("C") & Environment.NewLine _
& YearsInteger(6).ToString("N0") & ControlChars.Tab & AmountDecimal(6).ToString("C") & Environment.NewLine _
& YearsInteger(7).ToString("N0") & ControlChars.Tab & AmountDecimal(7).ToString("C") & Environment.NewLine _
& YearsInteger(8).ToString("N0") & ControlChars.Tab & AmountDecimal(8).ToString("C") & Environment.NewLine _
& YearsInteger(9).ToString("N0") & ControlChars.Tab & AmountDecimal(9).ToString("C") & Environment.NewLine _
& YearsInteger(10).ToString("N0") & ControlChars.Tab & AmountDecimal(10).ToString("C") & Environment.NewLine
Code:InformationString = "Year" & ControlChars.Tab & "Amount on deposit" & Environment.NewLine
for a as integer = 1 to 10
informationString &= YearsInteger(a).ToString("N0") & ControlChars.Tab & AmountDecimal(a).ToString("C") & Environment.NewLine
next
Nvm, apparently I had the thingy set to "debug" and I changed it to "release" and it worked.
Haha yes, that does make it look a lot cleaner, thanks (:
Draw up a Dialog Box using the Form drawing box, and then use the Label controls or the TextBoxes to draw up a table. Or even use something like an Access table control or even an Excel table worksheet conrtrol, even...
I have been able to make a table control, using only Label controls. This means that you can fill up the data that is to be filled into them, using the max length and the position of the control. That coninsided with the position on the Form. This was then adapted to my Warhammer 40,000 wargame. That I was making for me, and my friends on my community network on the Internet, but never got around to finishing it, really!!
You could make a dialog box
and get the data like this
Code:Me.textbox1.Text = Form1.Textbox1.Text
Should we really be doing her homework for her?
Well as long as we are teaching her. And not doing it for her. But she will only be able to do it, if we are able to show her, how to do it. Because she will never learn in the short term.
Well, IMHO a little guidance is okay, but teaching is what the school is for.
And if some of the posts here (at VBF in general, not specifically this thread) are any indication, whether what the schools call teaching is debatable.
-tg
School only gets you so far sometimes.
Sad but true
yes, that is true!!