ZFGC
Resources => Coding => Topic started by: AoDC on October 13, 2006, 01:44:21 am
-
I have a MultiLine textbox, and if I wanted to change it, does anybody know what a multiline character would be?
Thanks.
-
Not sure I get the question.. I'm not so good with VB terminology...
vbcrlf might be it?
-
I had the same problem when I wrote a VB program as well, I put \ns in it, and boy was I shocked when they showed up as \n in the string. It's kind of silly, too, because \n works in C#, C++/CLI, and J#, so you'd think they'd try and make VB follow along the same lines since they're all included in Visual Studio.
-
As in, I want so itll be like
txtDisplay.Text = "Line 1
Line 2
Line 5"
or
txtdisplay.Text = "Line1*Line2*" Where * is the New Line marker.
-
txtDisplay.Text ="Line1" & vbcrlf & "Line2"
Goodnight was correct.
-
Oh ok. Thanks a bunch Goodnight and Dayjo.
-
No problemo anytime.
What you making in VB anywho?
-
Washing Machine. Its my software des & dev assignment for school. I have an MMO but here I am doing a washing machine. So boring... Everyone in school sucks and is always asking for help :/
-
you have to create a washing machine..in VB? O.o
-
Yes. The class is full of noobs that still dont know why .Text = string without quotation marks doesnt work. My teacher knows alot of Microsoft Access, and some VB, and thats it. We cant go any further.
We dont do games until next year =(. My teacher asks ME for help, and I only learnt VB basics in a day.
Here's the machine:
(http://img.photobucket.com/albums/v217/ageofdarknesscreator/untitled-1.png)
Code:
Dim RemSeconds As Integer 'Remaining seconds in timer
Dim RemMinutes As Integer 'Remaining minutes in timer
Dim HasStarted As Boolean 'User has started wash
Private Sub cmdPower_Click() 'When user click power
If cmdPower.Caption = "Power" Then
If frmMain.Width = 1395 Then
frmMain.Width = 8265 'If the form is closed, open it
Else
frmMain.Width = 1395 'If it is open, close it
End If
Else
If cmdPower.Caption = "Stop" Then 'If stop is the option
cmdPower.Caption = "Power" 'Change back to power
HasStarted = False
RemSeconds = 60 'Set RemSeconds to 59 by default
RemMinutes = 1 'Set RemMinutes to user input
'Reset display text
txtDisplay.Text = "Ready to Wash" & vbCrLf & vbCrLf & "Please select the appropriate settings."
vsDirtLevel.Enabled = True 'Enable
FrameFCare.Enabled = True 'the
cboTemp.Enabled = True 'options
End If
End If
End Sub
Private Sub cmdStartPause_Click()
If cboTemp.Text = "Temp." Then
MsgBox "You did not select a temperature. One has been set for you. Cancel the wash to select one."
cboTemp.Text = "Warm"
End If
If cmdStartPause.Caption = "Start" Then 'If the washing has yet to start
If HasStarted = False Then 'If user has not started washing
HasStarted = True 'User has started washing
Timer1.Enabled = True 'Start the seconds timer
RemSeconds = 60 'Set RemSeconds to 59 by default
RemMinutes = 1 'Set RemMinutes to user input
txtDisplay.Text = "Washing..." & vbCrLf & "-----------------" & vbCrLf & "Time Remaining: " & RemMinutes & ":" & RemSeconds 'Update Display
cmdStartPause.Caption = "Pause" 'Set caption to Pause
cmdPower.Caption = "Stop" 'Change Power to Stop
cmdPower.Enabled = False 'Enabled power again
vsDirtLevel.Enabled = False 'Disable
FrameFCare.Enabled = False 'the
cboTemp.Enabled = False 'options
Else
Timer1.Enabled = True 'Continue timer
cmdStartPause.Caption = "Pause" 'Show pause option
cmdPower.Enabled = False 'disable power button
End If
Else
Timer1.Enabled = False 'stop counting
cmdStartPause.Caption = "Start" 'Show start option
cmdPower.Enabled = True 'Enabled power again
End If
End Sub
Private Sub Form_Load()
'Timer is not enabled (no countdown yet)
Timer1.Enabled = False
'User has not started wash
HasStarted = False
'Why not show a little message on startup?
MsgBox "Thank you for using my Washing Machine.", vbInformation, "Alert"
'Shrink the GUI on loading to hide controls
frmMain.Width = 1395
End Sub
Private Sub Timer1_Timer()
txtDisplay.Text = "Washing..." & vbCrLf & "-----------------" & vbCrLf & "Time Remaining: " & RemMinutes & ":" & RemSeconds 'Update Display
RemSeconds = RemSeconds - 1 'Remove a second
If RemSeconds <= 0 Then 'If seconds are less than one
If RemMinutes <= 0 Then 'If minutes are less than one
MsgBox "Wash Completed.", vbInformation, "Alert" 'Notify user the wash is complete
Timer1.Enabled = False 'Stop the timer
Else
RemMinutes = RemMinutes - 1 'Remove a minute
RemSeconds = 60 'Reset seconds to 60
Timer1.Interval = 1000 'Reset timer to one second
End If
End If
txtDisplay.Text = "Washing..." & vbCrLf & "-----------------" & vbCrLf & "Time Remaining: " & RemMinutes & ":" & RemSeconds 'Update display again to prevent lag
End Sub
-
Be careful AoDC or you might winde up TEACHING the class n_n.
What languages do you know???
-
rofl. Thatd be right.
A few. Java, C++, VBasic, HTML (language? :/), GML and some C#. Not sure what else.
-
That is a pretty good list but i'm NOT going to ask Helios what he knows anywho...
HTML is more of a scripting language because it is interpreted by the browser (being client side)
-
Thanks for the intel.
And Helios made a list in some post... it contained a list of about 8 languages :P
-
Thanks for the intel.
And Helios made a list in some post... it contained a list of about 8 languages :P
And that was not all of them, he said he was stopping the list there, so he knows quite a few...
EDIT:
C++ / C# / ObjC / C / BlitzMax / Blitz+ / Blitz3D / Blitz2D / Assembly / Java / Pascal / Delphi / etc.
It would take ages to list the languages I use, as I'm fluent in so many and I switch between them so frequently.
which reminds me... Could someone PM me with which programming languages I should learn leading up to at least C/C++, plz (like the most basic one through C/C++?
-
If you know GML and computer logic than C++ Should be easy. Not saying that GML is much like C++...but the syntax is slightly similar for if statements/for loops/ etc. so it's easy to jump into the basics and work from there.
HTML is more of a scripting language because it is interpreted by the browser (being client side)
Technically HTML is considered a 'Markup' language. HTML stands for HyperText Markup language. Markup is a way of describing data; HTML does it with tags, such as and etc, that surround teh text that you want to 'mark up'.
-
On topic: You can also use vbnewline for the same effect.
Off topic: I know the feeling.
Teacher: "Class your assignment is to make a calculator."
Me: "Done. Now what?"
Teacher: "Teach them how."
Little did I know that they had done no work on vb at all. I blame the flu for this.
-
On topic: You can also use vbnewline for the same effect.
Off topic: I know the feeling.
Teacher: "Class your assignment is to make a calculator."
Me: "Done. Now what?"
Teacher: "Teach them how."
Little did I know that they had done no work on vb at all. I blame the flu for this.
Cool, but my code is already done :P. And thank god I am not alone.