Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
GeneralRe: Security hacking Pin
MAW3010-Dec-13 14:02
MAW3010-Dec-13 14:02 
GeneralRe: Security hacking Pin
Eddy Vluggen11-Dec-13 0:32
professionalEddy Vluggen11-Dec-13 0:32 
GeneralRe: Security hacking Pin
MAW3011-Dec-13 7:29
MAW3011-Dec-13 7:29 
GeneralRe: Security hacking Pin
MAW3011-Dec-13 16:30
MAW3011-Dec-13 16:30 
GeneralRe: Security hacking Pin
Eddy Vluggen12-Dec-13 8:37
professionalEddy Vluggen12-Dec-13 8:37 
QuestionEmgu CV Iris detection Pin
gouthaman939-Dec-13 6:49
gouthaman939-Dec-13 6:49 
AnswerRe: Emgu CV Iris detection Pin
Marco Bertschi10-Dec-13 0:09
protectorMarco Bertschi10-Dec-13 0:09 
QuestionConversion to VB results in errors Pin
Sonhospa9-Dec-13 6:39
Sonhospa9-Dec-13 6:39 
Dear all Smile | :)

I converted a sample from C# to VB and get an error message. It looks simple, but still I don't understand... Would it be possible that C# allows calling an event directly, while VB doesn't? Or did my conversion tool go wrong? D'Oh! | :doh:

Here's the short sample code:
private void OnWaveControlContextMenuPopup(ContextMenu menu)
 {
   if (this.WControlContextMenuPopup == null)
     return;
   this.WControlContextMenuPopup(menu);
 }
where WControlContextMenuPopup is defined as an event:
public event WControlContextMenuPopupDelegate WaveControlContextMenuPopup;

After conversion I get the error message "Public Event WControlContextMenuPopup in an event and cannot be called directly. Use 'RaiseEvent'...". The error is shown in lines 2 and 5 of the converted code:
Private Sub OnWControlContextMenuPopup(menu As ContextMenu)
    If Me.WControlContextMenuPopup Is Nothing Then             <-----
        Return
    End If
    Me.WControlContextMenuPopup(menu)                          <-----
End Sub

What would I have to change in the VB code to get the required result without error?

Thanks for some insight... Cool | :cool:
Mick
AnswerRe: Conversion to VB results in errors Pin
Richard Deeming9-Dec-13 7:26
mveRichard Deeming9-Dec-13 7:26 
GeneralRe: Conversion to VB results in errors Pin
Sonhospa9-Dec-13 7:54
Sonhospa9-Dec-13 7:54 
GeneralRe: Conversion to VB results in errors Pin
Richard Deeming9-Dec-13 8:03
mveRichard Deeming9-Dec-13 8:03 
GeneralRe: Conversion to VB results in errors Pin
Sonhospa9-Dec-13 8:22
Sonhospa9-Dec-13 8:22 
AnswerRe: Conversion to VB results in errors Pin
Dave Kreskowiak9-Dec-13 7:27
mveDave Kreskowiak9-Dec-13 7:27 
GeneralRe: Conversion to VB results in errors Pin
Sonhospa9-Dec-13 7:51
Sonhospa9-Dec-13 7:51 
GeneralRe: Conversion to VB results in errors Pin
Dave Kreskowiak9-Dec-13 7:56
mveDave Kreskowiak9-Dec-13 7:56 
GeneralRe: Conversion to VB results in errors Pin
Sonhospa9-Dec-13 8:22
Sonhospa9-Dec-13 8:22 
QuestionCoding Style Questions Pin
Kevin Marois9-Dec-13 6:00
professionalKevin Marois9-Dec-13 6:00 
AnswerRe: Coding Style Questions Pin
PIEBALDconsult9-Dec-13 6:33
mvePIEBALDconsult9-Dec-13 6:33 
GeneralRe: Coding Style Questions Pin
Kevin Marois9-Dec-13 6:59
professionalKevin Marois9-Dec-13 6:59 
GeneralRe: Coding Style Questions Pin
PIEBALDconsult9-Dec-13 9:30
mvePIEBALDconsult9-Dec-13 9:30 
GeneralRe: Coding Style Questions Pin
Kevin Marois9-Dec-13 9:51
professionalKevin Marois9-Dec-13 9:51 
GeneralRe: Coding Style Questions Pin
PIEBALDconsult9-Dec-13 10:02
mvePIEBALDconsult9-Dec-13 10:02 
AnswerRe: Coding Style Questions Pin
V.9-Dec-13 20:51
professionalV.9-Dec-13 20:51 
QuestionEye tracking code Pin
polycom1239-Dec-13 5:44
polycom1239-Dec-13 5:44 
QuestionPersists GridView Textbox Value Pin
wernlin9-Dec-13 5:22
wernlin9-Dec-13 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.