C# Tools, Techniques, and Fixes

 

Downloading the Language

This following video will show you how to find Visual Studio on the internet and then download and install it on your machine.

The Debugger

A logic error is a mistake that does not prevent an application from running but causes the application to produce incorrect results.  Mathematical mistakes, assigning a value to the wrong variable, or assigning the wrong value to a variable are example of logic errors.

Logic errors can be difficult to find.  Today Visual Studio, Python, Java, and virtually all the most common languages have tools that make the debugging process easier. In Visual Studio it’s called the debugger.

Moving Your Application

to move an application to a new location you need to more everything and keep everything together.  Visual Studio creates a lot of files.  Zip will allow you to compress that application in total and place it in a new location where it can be safely opened.  The project will run as normal in the new location

Flowcharting

Things can get a little dicey when applications get complex. That’s when we really need that plan. And that plan is a flowchart.

I touched on flowcharting back in the decision section when we looked at the nested decision structure. Remember? One “if” statement was inside another. Flowcharting that concept allowed us to see the logic and how complicated it might get. Well loops can be nested as well. Not only that but just a single loop might be better understood if we could see a picture of what we are trying to do. Best to flowchart it.

Removing Unwanted Event Handlers

We’ve all done it. Double clicked on an object and accidentally created an event we didn’t want or need. This video shows you how to get rid of such events.

Preventing Negative Numbers, Garbage, and Unreasonable Data

The actual code we write in a program to process data is nothing compared to the code we need to write to make sure proper data gets to the calculation portion of our program. This Video demonstrates the code needed to make sure proper data gets to the calculation portion of our program.

Fixing File Processing Issues

When it comes to file processing it doesn’t take too long to understand how to write the code to read and write a file.  But when it comes to implementing the process in a program it can be easy to make mistakes you don’t expect. These are two short videos that demonstrate that point.

Non-Default Mouse Events

While every object has a default event, every object also has a large number of non-default events. These are events available to the programmer to allow the object to act in some different way. Some of the most popular are “mouse” events. There’s MouseHover, MouseLeave, MouseDoubleClick, and others.

This next short video shows how you can access them.

Multiple Forms

What is a multi-form application? It’s just like it sounds. Multiple forms. You’ve used them all the time and maybe just weren’t aware that they were multi-form. Your phone’s apps are a good example. There’s only so much real estate on a phone’s screen. And when you need to display a lot of information it makes sense to use a number of forms and only display what is relevant at the time.

This video gives you the basics. It shows how you can create a form. Add data to a form. Display multiple forms, and so on. And it’s pretty easy.

The Image List Control

The ImageList control is a tool. But it’s a tool that contains an array. It allows you to store a number of images in your application and assigns an integer index to each picture. Using that index you can refer to the image list control from a Picture Box, a Label, a Button, any control that can accept an image.

I used this concept when I created the video titled “How Numeric Variables are Stored”. You can see that part of the video behind me now. Note that there are 12 picture boxes in the application capable of showing the bytes used for the numbers 0 through 9 including a minus sign. These images are stored in an ImageList control and displayed when needed.

And yes, an array is involved.

This next video will show you how to set up the ImageList control and use it. In fact, we’ll build the simple Poker Hand video you see behind me now. This will be a fun one.