sure. its a vb.net windows applicaiton with one form.
'//In a button handler
console.clear()
console.writeline("Hello World")
'// Thats it.
Cheers
Okay, now I'm getting worried. Did you run the application without the
Console.Clear() call? Unless I've really forgotten something Window's
based applications ignore the calls to the Console class, as it
doesn't exist.
Excerpt from the MSDN documentation (
http://msdn2.microsoft.com/en-us/
library/system.console(VS.71).aspx):
<quote>
The Console class provides basic support for applications that read
characters from, and write characters to, the console. If the console
does not exist, as in a Windows-based application, writes to the
console are not displayed and no exception is raised.
</quote>
If you really need to have both a console window and standard forms
you need to create a console project. Then reference the appropriate
dll's (such as System.Windows.Forms) and then create the form classes
you need.
The following code sample requires a new console project and
references to System.Windows.Forms and System.Drawing to work.
////////////////
Imports System.Windows.Forms
Imports System.Drawing
Module Module1
Sub Main()
Application.EnableVisualStyles()
Console.WriteLine("Showing form...")
Console.WriteLine("Be sure to look behind me, the form is
sometimes hidden behind me")
System.Threading.Thread.Sleep(1000)
Dim f As New Form()
f.Text = "My Custom Form"
Dim b As New Button()
AddHandler b.Click, AddressOf button_Click
b.Width = 100
b.Location = New Point(100, 100)
b.Text = "Click Me"
f.Controls.Add(b)
f.ShowDialog()
Console.WriteLine("You just closed the form")
Console.WriteLine("Goodbye")
System.Threading.Thread.Sleep(1000)
End Sub
Private Sub button_Click(ByVal sender As Object, ByVal e As
EventArgs)
Console.Clear()
Console.WriteLine("Hello World from the Windows Form!")
Console.WriteLine("The current time is: {0}",
DateTime.Now.ToString("h:m:s tt"))
End Sub
End Module
////////////////
Hope That helps!
Thanks,
Seth Rowe