Windows Forms C# - Working with directories and files

Reading from a text file Text files provide the ideal solution for reading and writing data that should be used frequently, but too voluminous to manually enter each time the program is started.
| | | | | |
2018/02/07 04:42

Windows Forms C# - Drawing and GDI+

| 2018/02/03 05:08
The System.Drawing and GDI + package The System.Drawing package provides access to GDI + Windows features:
  • Drawing surfaces
  • Working with graphics and graphical transformations
  • Drawing geometric shapes
  • Working with images
  • Working with text and fonts
  • Printing on printer

Windows Forms C# - Forms and Dialogs

| 2018/02/02 22:01

Forms and dialogs in Windows Forms are windows that contain controls. They can be different types: to have or to not have a frame, to be modular or not to be, to be stretchable or not to be, to be above all other windows or not to be, and so on. The System.Windows.Forms.Form class The System.Windows.Forms.Form class is a base class for all for

Windows Forms C# - Loops and Arrays

| 2018/02/02 13:42
Loops 
Programming often requires repeated execution of a given sequence of operations. Loop is a basic programming design that allows multiple execution of a source code snippet. Depending on the type of the loop, the program code in it is repeated either a fixed number of times or while a condition is in effect. A loop that never ends is called an infinite loop.

Windows Forms C# - Variables, Strings and Boolean

Variables: The variable is a container of information that can change its value. It provides the opportunity for:
| | | | | | |
2018/02/02 02:07

Windows Forms C# - Controls and Code writing

| 2018/02/01 23:41
Control class The System.Windows.Forms.Control class is a base class, the basis for all graphical controls, and defines a unified control framework - a programming model on which controls to be developed and implemented. It defines the common properties and events for all controls.

Introduction to .NET Framework, C# (C Sharp) and Windows Forms

| 2017/10/05 03:59

Microsoft .NET Framework

Microsoft .NET Framework is technology for building and running .NET applications. It provides a standard library of classes and a run-time environment called Common Language Runtime (CLR).CLR is the foundation of the .NET Framework. It manages code at execution time, memory management, thread management, remoting.

c# combobox set selected item by item's text

| 2017/10/05 02:52
C# Combobox defined with name my_combobox
private System.Windows.Forms.ComboBox my_combobox;

Define string variable with the text of the combobox item that has to be selected. For example, if the combobox items have text values "item_a" "item_b" "item_c" ... and the item which text is "item_b" has to be selected
TAGS: |

C# - Get database connection string from Web.config file


To get the database connection string from IIS Web.config file using C# code, include System.Configuration directive and then create a string variable to assign the connection string like this:
using System.Configuration;
string connStr = ConfigurationManager.
                  ConnectionStrings["connectionString_Name"].ConnectionString;
If “ConfigurationManager” is not recognized you will need to add reference to: "System.Configuration".See: C# - How to add reference to project


| |
2017/10/05 02:45

C# Textbox - enter only positive numbers on KeyPress event in Windows form application


To prevent users from entering incorrect data in Windows form application, set restriction to allow only specific characters to be entered in the text box.This example uses KeyPress event to monitor the users input and to apply the restriction required.To avoid code duplication in Windows multiform applications for example, a separate class file is created “CommonFunctions.cs”.
The function to allow only numbers in textbox control is named InputNumbers.
For each Windows form, create a single KeyPress event and call the InputNumbers function inside it.
| |
2017/10/05 02:27

C# How to draw shapes – Circle, Rectangle, Arc, Pie, Polygon, Bezier, Text

In order to draw shapes in C# a start point and end point coordinates, and a Pen control must be defined first.
Coordinates in C#The value of x is the location of the point along the x-axis, the 0 is at the extreme left. The value of y is the location of the point along the y-axis, the 0 is at the extreme top.
| |
2017/10/05 01:56