Creating a Windows Application
Let's create your first, very simple Windows application with DataFlex.
Windows Application
A Windows application in DataFlex is a Multiple-Document Interface (MDI) Application. The application is a container into which child components, such as data entry views and report views, are placed.
There are numerous other features of Windows applications that DataFlex creates for you, such as menus and toolbars. These features will be discussed in more detail in Standard Windows Application Features.
Creating a Windows Application
-
Click on the Workspace Dashboard tab. If the Workspace Dashboard tab is not open, click on the Workspace Dashboard toolbar button.
-
Click on the Create a project link in the Workspace Dashboard.

-
On the Project tab of the Create New... dialog, double-click the Windows Project icon.

Tip: You can use the Test Windows Project during development. This project has some special test features, such as auto-activation of views, automatic sizing of the main program panel, and a Data Dictionary Inspector. You can also look at the source code of this type of project to see how to implement such features in your projects. For this tutorial, please use the Windows Project instead, to be able to follow all of the steps in the tutorial as they are explained.
- The "Create a New Windows Project" dialog will open. Enter MyFirstWindowsApplication as the file name and click on the OK button. Accept the default location (the AppSrc folder in the QuickStart workspace) and the dialog will automatically add the .src extension to your filename (the extension for application components).

Naming a Project
A project, in this case a Windows application, might consist of one or more components, such as views, reports, and various other components and objects. The name is usually something that identifies the whole project, such as the client company’s name, or maybe a description such as "Accounting System".
- You will see the new Windows Application open in the Windows Designer on a new tab in the Studio. The Windows Designer is one of the designers available in the Studio; it allows for designing visual aspects of your Windows application.
You can also view and edit the file's underlying source code in the code editor.

Tip: You can press F7 to toggle between the two different views (code editor and Windows Designer) of the current file.
-
If you now click on the Workspace Dashboard tab, you will see that the contents have changed significantly. It shows you the project you have just created, as well as Components of that project (there are none at this point). It now also shows an Open Items section. Read more about the Workspace Dashboard here.

-
Return to MyFirstWindowsApplication.src in the Windows Designer. If the Code Explorer window is not open, or if it is not the top tab in an open Studio docking pane, click on the Code Explorer toolbar button.

-
In the Code Explorer window (this window is located on the left by default), you will see an outline of the current source file in a tree. There are nodes that represent other source files that are used in this file, objects, and methods.

-
Click on the Properties toolbar button to open the Properties window.
As you click on different objects in the Code Explorer window, notice that the properties of the currently selected object are displayed in the Properties window (this window is located on the right by default).
Notice also that, as you select different objects in Code Explorer, the same object becomes selected in the Windows Designer (provided that it is an object that can be visually modeled), and vice versa. If you click on a file, the Properties window will show "Nothing to Model".
-
For example, click on the + in the Code Explorer's tree view to expand oMain, then click on the + to expand CommandBarSystem. Select object oFindToolBar. You will notice that the same object becomes selected in the Windows Designer.

-
If you select any other object in the Windows Designer, it will also become selected in Code Explorer.
-
Select the oMain object in Code Explorer, and change the Label property to My First Application in the Properties window.
Notice that the Windows Designer immediately reflects the changed label. The caption bar for the modeled application now displays "My First Application".
-
Double-click on the oMain object in Code Explorer. The code editor window will place the edit cursor at the beginning of the object declaration line for oMain (and bring that line of code into view in case it was scrolled off the page). You can see that the "set Label" statement reflects the change to the value of the Label property you just made in the Properties window.

-
Change the set Label statement in the source code from My First Application to My First Windows Application. When you select the oMain object in Code Explorer again, you will see that the value of the Label property in the Properties window has been updated to reflect the source code change you just made.
Tip: While in the code editor, you can press Ctrl+F7 to locate the object you are currently editing in Code Explorer. This will automatically select the object and bring up its properties in the Properties window (if this window is open).
-
Press F7 to switch back to the Windows Designer. Notice that the change you made to the label property is once again reflected in the Windows Designer.
You have now created your first Windows application. Of course, at this point, the application is only a container with menu bars, toolbars, and a status bar. Soon, you will learn how to add views and other components to it.