T
Thorsten Adams
Hello newsgrouplers!
In C# there is a code
EControl window = ControlDeclarationManager.Instance.CreateControl(
"Gui\\MessageBoxWindow.gui" );
Controls.Add( window );
window.Controls[ "MessageText" ].Text = messageText;
window.Text = caption;
if( clickHandler != null )
( (EButton)window.Controls[ "OK" ] ).Click += clickHandler;
-----
I tried to convert it to VB.NET as:
Dim window As EControl =
ControlDeclarationManager.Instance.CreateControl("Gui\MessageBoxWindow.gui")
Controls.Add(window)
window.Controls("MessageText").Text = messageText
window.Text = caption
If clickHandler IsNot Nothing Then
DirectCast(window.Controls("OK"), EButton).Click +=
clickHandler
End If
----
But DirectCast is not working because the IDE claims that +=
clickHandler was an event and that I should use RaiseEvent, but I don't
think that's the right way to go.
Can somebody help me?
Thank you very much!
Thorsten Adams
In C# there is a code
EControl window = ControlDeclarationManager.Instance.CreateControl(
"Gui\\MessageBoxWindow.gui" );
Controls.Add( window );
window.Controls[ "MessageText" ].Text = messageText;
window.Text = caption;
if( clickHandler != null )
( (EButton)window.Controls[ "OK" ] ).Click += clickHandler;
-----
I tried to convert it to VB.NET as:
Dim window As EControl =
ControlDeclarationManager.Instance.CreateControl("Gui\MessageBoxWindow.gui")
Controls.Add(window)
window.Controls("MessageText").Text = messageText
window.Text = caption
If clickHandler IsNot Nothing Then
DirectCast(window.Controls("OK"), EButton).Click +=
clickHandler
End If
----
But DirectCast is not working because the IDE claims that +=
clickHandler was an event and that I should use RaiseEvent, but I don't
think that's the right way to go.
Can somebody help me?
Thank you very much!
Thorsten Adams