Title Programming-C Language

Computer programming is a creative and careful creation of source codes to be used in computer systems configuration. Computer programmers come up with a sequence of written instructions written to perform specified tasks for a computer. These instructions are executable and they are also in human readable form but are translated into computer language that is understood by the computer for proper execution.

C Programming Language
C  is a programming language that the programmer uses to instruct the computer on what operations to carry out, how to do it and when to do it. It is a universal language used on the platform of many operating systems. When studying C, programmers make use of visual studio 2008.

One must create a new project in the visual studio platform to begin operating in this program. This is done by first launching micro soft visual c 2008 professional by clicking the start button, and go on to create the type of applications one needs on the main menu and click a file new project. This will pop up a new window with NewProject   window to appear containing a range of different types of projects.  The student goes ahead and selects the option of Windows Form Applications. At the bottom of the window is a field providing a project name that will most likely be WindowsForms Applications1. This is the title and one should customize it to a name of their choice, for example learningstage1 and press the OK button to initiate creation of new project (Gardener, 2010).

Adding Components
In this stage, one will be having their new visual studio project ready to begin the process of adding user interface components. They have a windows form (titled 1), which should be empty. The next step is to drag components from the tool box to the form (Gardener, 2010). To access this tool box one searches for the toolbox tab located on the left hand side of the main window of the visual studio application. This contains a number of different categories of components available for addition into the form.

When this is located, one then starts to drag and drop two button components and two text boxes onto the form (Gardener, 2010). Effort is made to resize them to fit and look professional. Change the default names to customized ones for each of the components. It is through these names that C code interacts with the user interface of the application so one must specify meaningful names.

To change these, there is a properties panel placed in the bottom right hand corner of the main visual studio application window. Start by choosing the top TextEdit component in the form area so that the panel displays the properties for this component. Scroll to the top of the list of properties until the name value is visible and change the name from TextBox1 to CreatingText. Repeat this task until you have renamed all the components in the form by changing the Name property. The second textbox should be named CodingText, and the buttons should be named trial1 and trial2 respectively. One can also change the displays on the components in the same procedure (Gardener, 2010).

Creating Events Using Components
Using the created form we can add functionality to the buttons such that events occur in our form. When the button is pressed a Click Event is created. And our work is to write a code for the Click events of our buttons (Gardener, 2010). For example, a Click Event for a close Button, one will have to double click and it will change to display the code for the application. This is the CloseButton_click event method (Gardener, 2010).
Using system

Using system.Collections.Generic

Using system.Sytstem.ComponentModel

Using system.Data

Using system.Drawing

Using system.linq

Usingsystem.Windows.Forms

Namespace HelloCsharp
 
Coding an Object or Event
One is required to refer back to the names of the components when the first textbox which is CodingText will be input with information. The latter will be displayed in CreatingText by pressing the trial1 button. Above the code area click on the Form1.csDesign tab to return to the visual view of the fork and double click on trial1 button to access code. This time we will add code to the trial1_Click event method to read a value from CodingText . It will be combined with some little text to display the result in CreatingText
private void trial1Button_Click(object sender, EventArgs e)

The above code is executed when the buttons trial1 is pressed. And the text hello is displayed in CreatingText text box (payload media, 2009).

Conclusion
These are simple processes that can be learnt by a beginner in Visual studio 2008. The process of adding or populating a form and showing what it can display. After a user learns the above he is ready to engage in more practical coding and adding event triggers.

0 comments:

Post a Comment