
\documentclass[dvipsnames,cmyk]{article}
\usepackage{listings,xcolor}
\lstset
{
breaklines=true,
tabsize=3,
showstringspaces=false
}
\lstdefinestyle{Common}
{
extendedchars=\true,
language={[Visual]Basic},
frame=single,
%===========================================================
framesep=3pt,%expand outward.
framerule=0.4pt,%expand outward.
xleftmargin=3.4pt,%make the frame fits in the text area.
xrightmargin=3.4pt,%make the frame fits in the text area.
%===========================================================
rulecolor=\color{Red}
}
\lstdefinestyle{A}
{
style=Common,
backgroundcolor=\color{Yellow!10},
basicstyle=\scriptsize\color{Black}\ttfamily,
keywordstyle=\color{Orange},
identifierstyle=\color{Cyan},
stringstyle=\color{Red},
commentstyle=\color{Green}
}
\lstdefinestyle{B}
{
style=Common,
backgroundcolor=\color{Black},
basicstyle=\scriptsize\color{White}\ttfamily,
keywordstyle=\color{Orange},
identifierstyle=\color{Cyan},
stringstyle=\color{Red},
commentstyle=\color{Green}
}
\begin{document}
\begin{description}
\item[Visual Basic] is a programming language from Microsoft.
\begin{lstlisting}[style=A]%please try style=B
Option Explicit
Sub Signal(strSignalfolge As String, Optional lngTakt As Long = 100)
'Prozedur erzeugt eine Serie von Warntönen.
'Die optionale Variable lngTakt gibt den Takt in Millisekunden vor (Standard: 100 ms)
'Das Muster kann über die String-Variable strSignalfolge beeinflusst werden:
' Stern (*) -> 1 Warnton
' Ziffern 1..9 -> 1..9 Takte Pause
' Leerzeichen -> 1 Sekunde Pause
' Minus (-) -> 1.5 Sekunden Pause
End Function
\end{lstlisting}
\item[Visual CSharp] is my favourite programming language.
\end{description}
\end{document}