in

vbCity Blogs

New (temp) place for vbCity Blogs

Serge B. Blog

How to format source code in vbCity forums and blogs

To highlight code in your forum, blog and wiki posts wrap code into the folowing tags (example below is for VB.NET Code)

[code language="VB.NET"][/code]

Languages supported (in alphabetical order):

  • C
  • C++
  • C#
  • COBOL
  • Eiffel
  • Fortan
  • Haskell
  • HTML
  • Java
  • Javascript
  • Mercury
  • MSIL
  • Pascal
  • Perl
  • PHP
  • Python
  • Ruby
  • SQL
  • Visual Basic
  • VBScript
  • VB.NET
  • XML

Visual Basic example:

Public Sub CreateMyMultilineTextBox()
    ' Create an instance of a TextBox control.
    Dim textBox1 As New TextBox()

    ' Set the Multiline property to true.
    textBox1.Multiline = True
    ' Add vertical scroll bars to the TextBox control.
    textBox1.ScrollBars = ScrollBars.Vertical
    ' Allow the RETURN key in the TextBox control.
    textBox1.AcceptsReturn = True
    ' Allow the TAB key to be entered in the TextBox control.
    textBox1.AcceptsTab = True
    ' Set WordWrap to true to allow text to wrap to the next line.
    textBox1.WordWrap = True
    ' Set the default text of the control.
    textBox1.Text = "Welcome!" & Environment.NewLine & "Second Line"
End Sub

C# example:

public void CreateMyMultilineTextBox()
 {
    // Create an instance of a TextBox control.
    TextBox textBox1 = new TextBox();

    // Set the Multiline property to true.
    textBox1.Multiline = true;
    // Add vertical scroll bars to the TextBox control.
    textBox1.ScrollBars = ScrollBars.Vertical;
    // Allow the RETURN key in the TextBox control.
    textBox1.AcceptsReturn = true;
    // Allow the TAB key to be entered in the TextBox control.
    textBox1.AcceptsTab = true;
    // Set WordWrap to true to allow text to wrap to the next line.
    textBox1.WordWrap = true;
    // Set the default text of the control.
    textBox1.Text = "Welcome!" + Environment.NewLine + "Second Line";
 }

 

Only published comments... Sep 29 2008, 08:11 PM by Serge B.
Filed under: ,
Copyright 1998-2009 vbCity.com LLC
Powered by Community Server (Non-Commercial Edition), by Telligent Systems