100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
C# coding notes R99,00   Add to cart

Class notes

C# coding notes

 52 views  0 purchase

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

Last document update: 2 year ago

Preview 2 out of 14  pages

  • January 25, 2022
  • January 25, 2022
  • 14
  • 2021/2022
  • Class notes
  • Salah
  • All classes
All documents for this subject (11)
avatar-seller
Saaji
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.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Saaji. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R99,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

60434 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R99,00
  • (0)
  Buy now