C
C#2y ago
wcasa

✅ Window Forms.NET question..

are all of the objects that are accessible from toolbox (window forms .NET) created by using delegates and events that hold methods that we write in our code??
18 Replies
sibber
sibber2y ago
the designer generates the code that makes the ui for you controls (the objects that are accessible from toolbox) are basically a class that gets instantiated and added to the window you can see the generated code
wcasa
wcasa2y ago
private void button1_Click(object sender, EventArgs e)
{

}
private void button1_Click(object sender, EventArgs e)
{

}
this code looks like code of delegates, dont you think so?
sibber
sibber2y ago
not this the other generated code thats hidden by default
wcasa
wcasa2y ago
but are those buttons delegatesa/ ?
sibber
sibber2y ago
this is an event handler a delegate is a reference to a method this is the method that is being referenced
wcasa
wcasa2y ago
oh, right my bad :) the reason why i am asking this question is do i need to learn how delegates and events work in order to code WinForms .NET application?
sibber
sibber2y ago
it would help you understand the framework a lot better yes and its useful to know in general delegates are heavily used in LINQ for example
wcasa
wcasa2y ago
btw, where do you recommend to learning to build WindForm application?
sibber
sibber2y ago
i dont recommend winforms learn wpf/uwp/winui 3/avalonia wpf is probably the easiest to get started with since its the oldest, with the most resources online once you know one xaml framework it isnt hard to switch to another one
wcasa
wcasa2y ago
do they have same logic? in terms of programming language's logic
sibber
sibber2y ago
not sure what youre asking
wcasa
wcasa2y ago
if i know how to code in winforms, will i be able to code in avalonia ?
sibber
sibber2y ago
theyre all c# youll need to learn xaml but once you do, youll have a much much better experience than winforms you write the ui in xaml instead of using a designer
wcasa
wcasa2y ago
i dont have time :( it is for school project, we have to create application in c# winforms
sibber
sibber2y ago
oh well use winforms then the way i learned is by googling whenever i encountered an issue
wcasa
wcasa2y ago
!solved
sibber
sibber2y ago
$close
MODiX
MODiX2y ago
Use the /close command to mark a forum thread as answered