Drawing New Objects
To draw existing objects, program EasyDraw uses the rows in its DataTable object. When the user creates a new object, the program adds a new row to the DataTable. That modifies the data so it is central to the discussion of data safety.
The code in Listing 9.2 shows how program EasyDraw lets the user create a new object. This code uses several global-level variables. The m_DataRow variable represents a drawing object currently being created. The program sets the Boolean value m_Drawing to True while the user is drawing an object. The program uses the Bitmap object stored in m_BackBuffer to erase a new object while the user is drawing it. Finally, the m_SelectedTool object contains a reference to the toolbar button that is ...
Get Visual Basic® .NET Database Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.