Thanks Zsbzsb and Nexus.
I just return to home and recompile the code, this time it did not give out any error, but I fond the example use a method to draw text on screen cannot be found. Moreover, the event handler looks like not fired for close.
Here is my code, I just try to make it as simple as possible.
Module TestWithSFML
Dim WithEvents NewWindow
As RenderWindow
Sub Main
() Dim NewWindow
As RenderWindow
= New RenderWindow
(New SFML
.Window.VideoMode(1024,
768),
"My New Window") Dim windowsFont
As Font
windowsFont
= New Font
("tahoma.ttf") Dim text
= New Text
("Hello", windowsFont
) While (NewWindow
.IsOpen()) NewWindow
.DispatchEvents() text
.Position = New SFML
.System.Vector2f(250
.0F, 450
.0F
) text
.Color = New Color
(255,
255,
255,
170) End While End Sub ''' <summary> ''' Function called when the window is closed ''' </summary> Sub App_Closed
(ByVal sender
As Object,
ByVal e
As EventArgs
) Handles NewWindow
.Closed Dim window
= CType(sender, RenderWindow
) window
.Close() End Sub ''' <summary> ''' Function called when a key is pressed ''' </summary> Sub App_KeyPressed
(ByVal sender
As Object,
ByVal e
As KeyEventArgs
) Handles NewWindow
.KeyPressed Dim window
= CType(sender, RenderWindow
) If e
.Code = Keyboard
.Key.Escape Then window
.Close() End If End SubEnd Module Thanks.
Shadow