Actually, DXMenuItem has a constructor with string parameters, void. So he doesn’t like how I call the Count function with parameters. Cannot convert the type. How can I properly call a function with parameters?
|
2 answers
The DxMenuItem constructor DxMenuItem only two overloads with two parameters:
DXMenuItem(string caption, DXMenuItemPriority priority) DXMenuItem(string caption, EventHandler click) Most likely there was a second overload of the receiving click handler.
In this case, you can really pass lambda
new DxMenuItem(str, (s,e)=> Count(...)) - Yes, that's right. Apparently you are familiar with DevExpress. Thank you very much! I did not understand how to implement this technically. - Kama
|
The point is in the expected types of parameters for the DXMenuItem constructor. It is unlikely that the type of the second parameter is void (.
Actually, the DXMenuItem delegate has a constructor with string, void parameters.
It is also unlikely that the DXMenuItem type is a delegate. It seems that in the quoted phrase you are trying to describe the method signature: the parameter is string , the return value is void .
- onewell you, the gnomes tell you, but I’m not at all aware of what the author has the problem, but definitely with the types of parameters - tym32167
- I immediately realized that it was not void. The fact is that I don’t understand how to call Count with the void return type at the same time passing parameters. - Kama
|


я вызываю foo(bar()) но не работает, как исправить?- tym32167 pm