<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Dear Frank,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The following assumes a RichTextBox on a
form.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="COLOR: blue">Private</SPAN> <SPAN style="COLOR: blue">Sub</SPAN>
Form1_Load(<SPAN style="COLOR: blue">ByVal</SPAN> sender <SPAN
style="COLOR: blue">As</SPAN> System.Object, <SPAN
style="COLOR: blue">ByVal</SPAN> e <SPAN style="COLOR: blue">As</SPAN>
System.EventArgs) <SPAN style="COLOR: blue">Handles</SPAN> <SPAN
style="COLOR: blue">MyBase</SPAN>.Load<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Dim</SPAN> myString <SPAN
style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">String<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Dim</SPAN> val1 <SPAN
style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">Double<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Dim</SPAN> val2 <SPAN
style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">Double<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Dim</SPAN> formattedString <SPAN
style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">String<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>RichTextBox1.Text = <SPAN
style="COLOR: blue">String</SPAN>.Empty<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>myString = "Hello world"<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes"> </SPAN>val1
= 23.45<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes"> </SPAN>val2
= 67.89<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>formattedString = myString & ControlChars.Tab & val1.ToString
& ControlChars.Tab & val2.ToString &
ControlChars.CrLf<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>RichTextBox1.Text = formattedString<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: green">'If you want to take greater control, you can
set the tab positions.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: green">'Use code such as the following after
inserting the needed text.<SPAN style="mso-spacerun: yes">
</SPAN><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: green">'The code here will set the tab stops for all
the text in the rtb;<SPAN style="mso-spacerun: yes">
</SPAN><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: green">'if it is desired to set the tabs for only a
portion of text, <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: green">'modify the SelectionStart and SelectionLength
values.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; COLOR: green; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Dim</SPAN> myTabs() <SPAN
style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">Integer</SPAN> = {30,
150, 250, 350, 450} <SPAN style="COLOR: green">'Create an array of tab
positions<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>RichTextBox1.SelectionStart = 0<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>RichTextBox1.SelectionLength =
RichTextBox1.Text.Length<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>RichTextBox1.SelectionTabs = myTabs<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: green">'After applying the tabs,
<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN>RichTextBox1.SelectionStart = 0 <SPAN style="COLOR: green">'set the
cursor position (SelectionStart) to zero<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>RichTextBox1.SelectionLength
= 0 <SPAN style="COLOR: green">'set the length of the selection to
zero<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 8pt; COLOR: green; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="COLOR: blue">End</SPAN> <SPAN style="COLOR: blue">Sub</SPAN></SPAN><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></P></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But it's obviously not close to <FONT
face="Times New Roman" size=3>picOutput.print aword, i,
i^2</FONT><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>One of the things I do when stumped on such things
is to try vbCity, a forum where you can ask questions and usually get answers
that are accurate and that arrive within a day. <A
href="http://www.vbcity.com/forums/">http://www.vbcity.com/forums/</A> You
do need to log in to ask questions.</DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>You can print text as graphics to a VB.Net form or
control, but it wouldn't be any easier for students to understand. Some of
my students wanted to know how to use a graphics object and really enjoyed
exploring it, but I gather you're wanting something simpler than that
solution.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Alex Hopkins</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Frank Van Den Boom" <</FONT><A
href="mailto:vandenboomfj@aquinas.vic.edu.au"><FONT face=Arial
size=2>vandenboomfj@aquinas.vic.edu.au</FONT></A><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>To: <</FONT><A
href="mailto:is@edulists.com.au"><FONT face=Arial
size=2>is@edulists.com.au</FONT></A><FONT face=Arial size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Thursday, June 08, 2006 12:37 PM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: [Year 12 Its] VB.NET
questions</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial
size=2>>I am currently retraining myself from very basic VB to very basic
VB.NET. A question for more experienced VB.NET people out there...<BR>>
<BR>> To print a formatted table with a string (eg aword) in column 1,
integer (eg. i) in column 2, and integer in column 3 (eg i^2), VB6 can do it as
follows, where picOutput is a picture box or a form.<BR>> <BR>>
picOutput.print aword, i, i^2<BR>> <BR>> In VB.NET, the best I can do so
far using a rich text box (txt1) is as follows. It seems the Print command is no
longer supported in the previous form.<BR>> <BR>> txt1.Text = txt1.Text +
aword.padright(15, " ") + CStr(i).PadLeft(4, " ") + CStr(i ^ 2).PadLeft(6, " ")
+ vbCrLf<BR>> <BR>> Can anyone suggest a simpler approach that is closer
to the VB6 statement?<BR>> While there's some good learning in understanding
this statement for students, talk about trying to crack a walnut with a
sledgehammer......<BR>> <BR>> Frank<BR>> <BR>>
_______________________________________________<BR>> </FONT><A
href="http://www.edulists.com.au"><FONT face=Arial
size=2>http://www.edulists.com.au</FONT></A><BR><FONT face=Arial size=2>> IT
Systems Mailing List kindly supported by<BR>> </FONT><A
href="http://www.vcaa.vic.edu.au"><FONT face=Arial
size=2>http://www.vcaa.vic.edu.au</FONT></A><FONT face=Arial size=2> - Victorian
Curriculum and Assessment Authority and<BR>> </FONT><A
href="http://www.vitta.org.au"><FONT face=Arial
size=2>http://www.vitta.org.au</FONT></A><FONT face=Arial size=2> - VITTA
Victorian Information Technology Teachers Association Inc</FONT></BODY></HTML>