Adding a Single-record Form

So far, we have a form that displays clients in a read-only grid. Now we need a CRUD form, that is, a form that will let us create, update, and delete clients. We’ll create one from the GenericForm template and call it ClientForm. Notice that the form’s Text property, which is reflected as the form’s…

Continue reading Adding a Single-record Form

Let’s Run!

At this point, we have dropped a data source onto the form, and Visual Studio has done its code generation thing. We should be able to run the application and, even though we haven’t entered any data, we should at least get an empty form. So press F5 or click on the Start button. Hey,…

Continue reading Let’s Run!

Adding a Data Source to the Form

Create a new Data Source based on a database. You’ll need to add a new connection too. Since you installed dotConnect, SQLite should appear as an option when you add the new connection. Locate and select the database TheBooks.db. Save the connection as TheBooksConnectionString, if you’d like. Then select the Clients tables and call the…

Continue reading Adding a Data Source to the Form

Copying a Form

You know, that was a pretty cool form we made. The DGV can display rows from a table, and the sidebar on the left can have buttons and links. It seems like it could be used in different places. Can we keep it and just use a copy? In C#, you can base a form…

Continue reading Copying a Form

Our First Form

There should already be a Form1 in your project, created automatically by Visual Studio when you created the WinForms projects. There’s nothing in the form, and before putting things in it, we’re going to set a few properties on the form itself. First, size the form to something like 800 x 600. Then, set the…

Continue reading Our First Form