C#
C#

help

Root Question Message

Cumonsnow
Cumonsnow1/2/2023
✅ 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??
Cyberrex
Cyberrex1/2/2023
the designer generates the code that makes the ui for you
Cyberrex
Cyberrex1/2/2023
controls (the objects that are accessible from toolbox) are basically a class that gets instantiated and added to the window
Cyberrex
Cyberrex1/2/2023
you can see the generated code
Cumonsnow
Cumonsnow1/2/2023
        private void button1_Click(object sender, EventArgs e)
        {

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