Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,661 members, 7,955,393 topics. Date: Sunday, 22 September 2024 at 03:00 AM |
Nairaland Forum / Science/Technology / Programming / Beginning Microsoft C#.net (3537 Views)
How Do I Get A Value From Another Form Using C#.NET 2008 / C#.net Vs Vb.net Vs F# / Post Your C#.net Questions Here (2) (3) (4)
Beginning Microsoft C#.net by Segibambo(m): 10:08am On Nov 27, 2013 |
Before starting this thread i thought on how i could help student beginner programmers like me learn the c#.net and probably collaborate on projects Before starting this tutorial sections, i'd advise that you download visual c#.net express from http://www.microsoft.com Also,i would add some screen shots of completed codes so you can relatively compare with the ones you done This series of tutorial would be mostly based on mini projects,so sit down relax and sip some coffee while we delve into a world c#.Net |
Re: Beginning Microsoft C#.net by Segibambo(m): 10:16am On Nov 27, 2013 |
We are going to start our first series of tutorial by creating a simple calculator that can add,subtract,multiply and divide an input of am going to be using the visual studio 2010 or visual studio 2012 during the course of this project. i would upload the screen shot of the completed code. Feel free to ask me questions concerning the particular project we are currently working on. Questions that are irrelevant would be over-looked. |
Re: Beginning Microsoft C#.net by Adrenaline123(m): 10:18am On Nov 27, 2013 |
Grabs first chair, dusts and balance. OP, i dey greet |
Re: Beginning Microsoft C#.net by Segibambo(m): 10:23am On Nov 27, 2013 |
Yes purely op..so sit back and relax while i work around the visual studio to give the best explanation in the most simplest way as possible |
Re: Beginning Microsoft C#.net by Segibambo(m): 10:49am On Nov 27, 2013 |
Lets establish some concepts on the following listed below before we get started 1.variable : we would be using a lot of variables as we advance in this course. variables are temporary memory locations using a simple analogy, likening a box to a variable. We say that the box is empty if it doesn't contain anything,so it is for a varaible In c# variables are declared in this format Datatype variablename; that brings us to defining what a datatype means in c#.net we have various datatypes such as the integer,decimal,bool,double,string e.t.c are among the most commonly used datatypes are listed below the integer is used for whole numbers decimal for decimal numbers bool : true or false values string : used to store a series of text values a proper representation of declaring a variable in c#.net would be 1.Storing an integer number int number=1; 2.Storing a decimal number decimal number=2.3; 3.Storing a Boolean value decimal val=True; 4.Storing a string Value string message="Hello world"; As we progress further,you would understand its various features.. |
Re: Beginning Microsoft C#.net by Segibambo(m): 10:52am On Nov 27, 2013 |
If i may ask whats the meaning of op? i initially thought you were referring to oop!! |
Re: Beginning Microsoft C#.net by Adrenaline123(m): 11:05am On Nov 27, 2013 |
Segibambo: If i may ask whats the meaning of op? i initially thought you were referring to oop!! original poster, as in the thread opener |
Re: Beginning Microsoft C#.net by gadafi101(m): 10:19pm On Nov 27, 2013 |
@ segibambo Hi. Please i have a project to do in C#. Can u pls be of help to me? Thanks. |
Re: Beginning Microsoft C#.net by Segibambo(m): 9:14am On Nov 28, 2013 |
gadafi101: @ segibambo What is the 411 of the project |
Re: Beginning Microsoft C#.net by Segibambo(m): 9:17am On Nov 28, 2013 |
The first batch of codes and images would be coming up between 4:30-5:00pm....Please stay updated!! |
Re: Beginning Microsoft C#.net by Segibambo(m): 9:21am On Nov 28, 2013 |
I'd also like you guys to note that i'd be using visual studio 2012 during the course of this tutorial |
Re: Beginning Microsoft C#.net by micoyankee(m): 9:26am On Nov 28, 2013 |
Please continue, am following... |
Re: Beginning Microsoft C#.net by Javanian: 9:38am On Nov 28, 2013 |
Following. Please Continue. |
Re: Beginning Microsoft C#.net by dsypha(m): 9:38am On Nov 28, 2013 |
Segibambo: Lets establish some concepts on the following listed below before we get started Is this a mistake or it is how it really is Cos language influenced by C++ uses Boolean or boolean Please change it to bool |
Re: Beginning Microsoft C#.net by Segibambo(m): 12:35pm On Nov 28, 2013 |
dsypha: dsypha: its a mistake, thought i read through this thing very well....Thanks for the correction. |
Re: Beginning Microsoft C#.net by Segibambo(m): 3:58pm On Nov 28, 2013 |
1.Create a new windows form application project 2.Click on your newly added form and navigate to the properties windows change the name property from form1 to frmsimpleCalculator change the text property to simple calculator --Add five buttons,three labels and two textboxes on your form as seen in the screen shots and be sure to realign your controls for best fit --Now rename your controls at the property window as seen from the screen shots The first textbox should be named Txtfirstnumber The second textbox Txtsecondnumber --set the propertyname of the "+" button to btnplus the propertyname of the "-" button to btnsub the propertyname of the "*" button to btnmul the propertyname of the "/" button to btndiv set the name property of the label beside the "Check ans" button to lblanswer and its text property to "Ans would be displayed here" the name property of the first textbox to Txtfirstnum the name property of the second textbox to TxtSecondNum Step 2 Please make sure you pay more attention to this section as this is the main part of programming if you double click on your form you should see the following below The "//" symbol serve as comment, so am gonna be using it so asto explain the code areas [[[[ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; " The using part are name spaces in the .net framework.the are prewrittenclasses" using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Simple_Calculator { public partial class frmsimpleCalculator : Form { //In this area,we are going to define two global variables that we going to use throughout the code public frmsimpleCalculator() { InitializeComponent(); } } } ]]]] |
Re: Beginning Microsoft C#.net by Segibambo(m): 4:17pm On Nov 28, 2013 |
Form before naming
|
Re: Beginning Microsoft C#.net by Segibambo(m): 4:27pm On Nov 28, 2013 |
named form 2 Shares
|
Re: Beginning Microsoft C#.net by Segibambo(m): 4:29pm On Nov 28, 2013 |
Codes before and after
|
Re: Beginning Microsoft C#.net by Segibambo(m): 4:31pm On Nov 28, 2013 |
contents of the text files are as follows (if you don't feel like downloading it using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Simple_Calculator { public partial class frmsimpleCalculator : Form { double num1; double num2; double ans; public frmsimpleCalculator() { InitializeComponent(); } private void LblAnswer_Click(object sender, EventArgs e) { } private void btnplus_Click(object sender, EventArgs e) { num1 = Convert.ToDouble(Txtfirstnum.Text); num2 = Convert.ToDouble(TxtSecondNum.Text); ans = num1 + num2; LblAnswer.Text = ""; LblAnswer.Text = Convert.ToString(ans); } private void btnsub_Click(object sender, EventArgs e) { num1 = Convert.ToDouble(Txtfirstnum.Text); num2 = Convert.ToDouble(TxtSecondNum.Text); ans = num1 - num2; LblAnswer.Text = ""; LblAnswer.Text = Convert.ToString(ans); } private void btnmul_Click(object sender, EventArgs e) { num1 = Convert.ToDouble(Txtfirstnum.Text); num2 = Convert.ToDouble(TxtSecondNum.Text); ans = num1 * num2; LblAnswer.Text = ""; LblAnswer.Text = Convert.ToString(ans); } private void btndiv_Click(object sender, EventArgs e) { num1 = Convert.ToDouble(Txtfirstnum.Text); num2 = Convert.ToDouble(TxtSecondNum.Text); ans = num1 / num2; LblAnswer.Text = ""; LblAnswer.Text = Convert.ToString(ans); } private void btnCheckAns_Click(object sender, EventArgs e) { LblAnswer.Enabled = true; } } } |
Re: Beginning Microsoft C#.net by Segibambo(m): 4:35pm On Nov 28, 2013 |
I am open to questions If you have any problems, do ask On Tuesday next-week we would treat validation of input entry for this simple calculator project |
Re: Beginning Microsoft C#.net by Nobody: 9:21pm On Nov 28, 2013 |
Funny thing is am supposed to recover C# and the Whole .NET for a First Bank Test ? been a while i touched .NET |
Re: Beginning Microsoft C#.net by Segibambo(m): 9:46pm On Nov 28, 2013 |
pc guru: Funny thing is am supposed to recover C# and the Whole .NET for a First Bank Test ? been a while i touched .NET what are the probable contents of the test? |
Re: Beginning Microsoft C#.net by gadafi101(m): 6:21am On Nov 29, 2013 |
@segibambo Im to do a vehicle service system using C# and mysql and the system must generate a report. Thanks. Pls can u help me? |
Re: Beginning Microsoft C#.net by Nobody: 7:34am On Nov 29, 2013 |
Windows Service Background Service (I think it still means Window Service) C# VB.NEt (Who the f.u.ck uses this) ASP.NET Classic SQL Server to be frank it seems they are still on some old version on .NET though i will cover what i can, but hoping to get as much from here too as in Business Case Scenarios |
Re: Beginning Microsoft C#.net by ovanda(m): 6:07pm On Nov 30, 2013 |
[color=#000099][/color]hello people,please i need help with multi threading in java,thank you. 1 Like |
Re: Beginning Microsoft C#.net by Segibambo(m): 10:25pm On Dec 14, 2013 |
Its been a while i posted here Hope you guys are not annoyed, i have been quite busy doing some learning myself and also because i format my system and didn't copy a database i created, i'v been busy creating it from scratch with all the stored procedures and ish so getting off from where we stopped on creating a simple calculator, i would like to give an outline of four topics we would follow for the next two weeks, i would be using visual studio 2010 this time, please stay tuned and remember, never stop learning and relearning. |
Re: Beginning Microsoft C#.net by Segibambo(m): 10:28pm On Dec 14, 2013 |
pc guru: Windows Service taken the test? |
Re: Beginning Microsoft C#.net by Nobody: 8:00am On Dec 15, 2013 |
Not yet haven't been called, but for now am Learning WPF for a mini project for creches, tired of using web applications. |
Re: Beginning Microsoft C#.net by Raypawer(m): 12:44pm On Dec 15, 2013 |
phewwww flys back from church... gets ma laptop, get a chair, dust it.. moves to d front seat.... oya oga lets go there... calculator abi! nd other softwares with c#, this thread should be called "team c#" |
Re: Beginning Microsoft C#.net by tirex(m): 11:56pm On Dec 18, 2013 |
Following... |
Re: Beginning Microsoft C#.net by polarman(m): 8:52am On Dec 31, 2013 |
@Segibambo, thank u for this thread. i have been looking for where to learn this language. i just stumbled on this. i am joining this thread from today |
Phpbrowserbox 4.0 Is Out - Portable Webkit/PHP 7 Combined / Learn To Create Apps, Websites And Games With C#, Java And More / Need For More Programmers In Nigeria
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 48 |