100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

C# coding notes

Rating
-
Sold
-
Pages
14
Uploaded on
25-01-2022
Written in
2021/2022

This document comprises of basic and advanced c# rules. This includes instantiation, polymorphism, loops, arrays, collections and listboxes.










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
January 25, 2022
File latest updated on
January 25, 2022
Number of pages
14
Written in
2021/2022
Type
Class notes
Professor(s)
Salah
Contains
All classes

Content preview

C# coding
The first thing you are supposed to do when coding is assigning variables. Eg. String, int
Eg. String studentNumber; (local variables name)
String studentName;
Next you are going to say were the data is going to be collected from or too
studentNumber = txtStudentNumber.Text; (name of textbox)
studentName = txtStudentName.Text;
For int:
Int num1;
Num1 = int.parse(txtNum1.text);


Message Boxes
Several ways to code a message box. Message Box pdf for more methods.
MessageBox.Show(“Message that you want displayed”, “Title of message box”,MessageBoxButton.Ok (or
whatever button you want), MessageBox.Icon.Information (again can vary));


Line Breaks
Environment.Newline or \r\n or \n


Tooltips
Add message in properties by Tooltip on tooltip1 in textbox properties.


How to close a program
Close();


Access keys
Place a ‘&’ before the letter you want to be an access key


Changing the colour of the control
To change the colour of something due to another action click on that button and enter the name of the thing
you want to change followed by .BackColor = Color.(choose colour);
To change font click on font in properties.


Adding the enter and esc buttons
Set accept button in properties to true (enter button)
Set cancel button to true in properties (esc button)

, Data Types
For values use “=”. More in operators pdf.




Constants
Const type indentifier = expression;
OR public const int


To convert to a currency
(Variable name).ToString(“C”)


To show answer in textbox
(nameoftextbox).text = (variablename).ToString;


To disable a textbox
(textboxname).enabled = false;


Summaries
Variable += 1 or variable that is being counted.
Remember to set variable to 0 at beginning OR declare variable with constants and only set to 0 in method it is
being used. Do not forget ToString() in message box.
R99,00
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
Saaji

Get to know the seller

Seller avatar
Saaji Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
3
Member since
3 year
Number of followers
3
Documents
5
Last sold
1 year ago

0,0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions