-
I am working on a project right now for school, which is a periodic table. When soemone clicks on an element (command button) I want it to put certain information in a text box on another form. If they click another element, the information in the text box is kept, and the information from the 2nd element is added. I can figure out how do do that. I just dont know how to put information on multiple lines. ex: (code is put in to preserve formatting)
Code:
___Per. Table__ _____Text Box__________________
He is clicked -> |Element name (line one) |
|Atomic Number (line two) |
|Atomic weight (line three) etc|
--------------------------------
-
Code:
Public Sub Command1_Click()
Form2.Text1.Text = Form2.Text1.Text & "This is element 1"
End Sub
Public Sub Command2_Click()
Form2.Text1.Text = Form2.TExt1.Text & VbCrLf & "This Is Element 2"
End Sub
'And so on.
'VbCrLf will place the text on a new line. If you want to preserve format, then i would 1) suggest using a RichTextBox or 2) send vbTAB to move the text around a bit.
Hope that helps,
D!m
[Edited by Dim on 09-21-2000 at 05:33 PM]
-
set the textbox's multiline property to True and change the code to this
Code:
Public Sub Command1_Click()
Form2.Text1.Text = Form2.Text1.Text & VbCrLf & "This is element 1" & VBCR
End Sub
Public Sub Command2_Click()
Form2.Text1.Text = Form2.TExt1.Text & VbCrLf & "This Is Element 2" & VBCR
End Sub