❔ c# forms
Hi, I want to understand how forms in c# is working but dont know how
here is Windows Form Programming Practice Task what I want to do but dont know how :
Create an application that will serve as a purchase form. The user enters the name of the product, the price per item, the number of items, the product code, the company (which represents the product) and whether it is a VAT payer (radiobutton). After entering, the user presses a button that calculates the total price (increased by any VAT in the form of 21%) and stores the transaction number in the listbox (starting with 0001, 0002, 0003,...).
The user will be able to select the transaction in the listbox and list all its properties (Product name, price per piece, number of pieces, product code, company, whether it is VAT payer, total price, transaction number).
Create a button that adds up all the total prices of the transactions in the sheet and prints it to the MessageBox.
23 Replies
first off, don't use WinForms unless you're being obligated to
second, what are you having trouble with understanding?
I need to use windows forms for school,otherwise I wouldn't use it , I want to understand it but I can't manage to make a class,constructor and then I don't understand it anymore
is your issue actually with C#?
i dont uderstand that how i can do things easier or sometimes how to do something
like, have you built programs with C# before, without WinForms?
or in other languages?
no
i only tried
python
at school
and this is for a class?
and now i need to learn c# forms
yes
we now doing forms in c#
what have you done up until now?
just some work with Python?
we did things in the .net framework
and now we doing c# forms
only one hour he told some informations
did you have any previous assignments in C#?
what i dont remember and tomorrow will be correction test and I don't understand the code nor
here is code what is for this assigment in c# forms
look, the point I'm getting at is that expecting you to jump into GUI programming with no other experience in C# is objectively terrible
i know
but i need to learn it somehow at least for tests
I don't know how but
the instructor that's doing this is either bad at what they do, or you're not being genuine about what the class has covered so far, and you're panicking now that you've put it off to the last moment
regardless
C# is object-oriented
building programs in C# involves writing classes, and then using them
writing a class involves defining the class's state (fields) and logic (methods)
I.E.
values stored in memory that make up the state of the object
and executable code that runs when you tell it to, and reads or manipulates these values
making the jump to GUI programming means you'll do most of your work in the form of using EXISTING classes, that make up the GUI framework
classes that represent pieces of the GUI
the most basic being
Form
which, as its name suggests, represents a form to be presented to the user
generally, you'll describe YOUR form by writing a class that inherits from the Form
base class, adding controls to it, and then adding logic to describe how those controls interact
one of the other big things to realize about WinForms, especially when using Visual Studio, is that you don't "write" all of the codewe could look at the code together to see what's what and what it's for to get somewhere. so if you understand windows forms ?
a lot of it will be generated for you
i know what is that windows forms
im not 100% beginner in that
well, your initial question was "how does WinForms work", so....
if you have a more pertinent question, ask it
if you have something you've tried to do, but isn't working, ask about that
No one here is going to write this for you, or be interested in reading your entire codebase, even if this wasn't for classwork. We can help provide context, if you help us understand what context you need.
I understand
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.