Object Oriented ProgrammingControls<br />Advanced Visual Basic<br />
Overview<br />Visual Basic has many features that allow you to dynamically create controls and programs.  For example, you...
Controls at run-time<br />There are instances where the number of controls needed at run-time is variable.  Consider displ...
Controls at run-time (example)<br />This application reads from a database, creates labels that are sized based on time , ...
Controls at run-time<br />Creating a control at run-time<br />Dim txtBox as new TextBox()<br />txtBox.Text = “I am a textb...
Controls at run-time<br />Question: <br />Name some other instances where creating controls at run-time would be useful.<b...
Custom/Composite Controls<br />Composite controls provide a means by which custom graphical interfaces can be created and ...
Custom/Composite Controls<br />Custom controls are like DLLs.  You create these and then apply them to other applications ...
Custom/Composite Controls<br />Question: <br />What custom controls might you create?<br />
Additional Information<br />For additional information about these topics, please review your text and the links provided ...
Upcoming SlideShare
Loading in …5
×

Advanced VB: Object Oriented Programming - Controls

1,963 views

Published on

Object oriented programming - creating custom controls and creating controls at runtime.

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

Advanced VB: Object Oriented Programming - Controls

  1. 1. Object Oriented ProgrammingControls<br />Advanced Visual Basic<br />
  2. 2. Overview<br />Visual Basic has many features that allow you to dynamically create controls and programs.  For example, you can create your own objects in Visual Basic that can be used in many applications, just like DLLs.  You can also create controls at runtime. <br />
  3. 3. Controls at run-time<br />There are instances where the number of controls needed at run-time is variable. Consider displaying images on a scrollable form where the user can add as many images as they desire. <br />Example:<br />An instance that I use is for scheduling of classes/space. (see next slide)<br />
  4. 4. Controls at run-time (example)<br />This application reads from a database, creates labels that are sized based on time , and places them on the screen based on start time and location. If there is a double booking in a classroom, the label is made red. This shows the layout of classes for degree flow and space usage. <br />
  5. 5. Controls at run-time<br />Creating a control at run-time<br />Dim txtBox as new TextBox()<br />txtBox.Text = “I am a textbox”<br />txtBox.Location = New System.Drawing.Point(10, 55) <br />txtBox.Size = New System.Drawing.Size(130, 95) <br />
  6. 6. Controls at run-time<br />Question: <br />Name some other instances where creating controls at run-time would be useful.<br />
  7. 7. Custom/Composite Controls<br />Composite controls provide a means by which custom graphical interfaces can be created and reused. <br />A composite control is essentially a component with a visual representation. As such, it might consist of one or more Windows Forms controls, components, or blocks of code that can extend functionality by validating user input, modifying display properties, or performing other tasks required by the author. <br />Composite controls can be placed on Windows Forms in the same manner as other controls.<br />
  8. 8. Custom/Composite Controls<br />Custom controls are like DLLs. You create these and then apply them to other applications (as many as you like). <br />There are companies that focus on creating custom controls and sell them to developers.<br />Example:<br />ActiveBarCode.com<br />
  9. 9. Custom/Composite Controls<br />Question: <br />What custom controls might you create?<br />
  10. 10. Additional Information<br />For additional information about these topics, please review your text and the links provided in Blackboard.<br />

×