Visual Basic Examples
Visual Basic Examples
Saul Greenberg
Saul Greenberg > courses > HCI topics > visual basic
These pages collect example tutorials, programs and ActiveX controls displaying particular
programming techniques in Visual Basic.
Further Assistance
We cannot offer any further help with these examples. Most were developed by
students who are no longer present. Our current students have moved onto
programming in C#, and thus no longer use VB. Please do not contact us for further
help, although feel free to tell us that this page was useful to you!
Other VB resources
Planet Source Code.com has lots of searchable example programs and tutorials
ECommerce Webopedia: ActiveX controls is a page of links, but not sure how good it is for
VB
Tutorials
These tutorials contain step by step graphical guides to several visual basic programming
concepts and tools. Note that they are not necessarily in progressive order!
Basic
http://pages.cpsc.ucalgary.ca/~saul/vb_examples/ 1/7
2/4/2016 How to register your ActiveX Controls
Visual Basic Examples on the Computer
Science machines
#7 Building a Ticker ActiveX Control with the ActiveX Mike Rounding
Rod Stephens
Control Wizard
#8 Building a Transparent ActiveX Control that lets you Mike Rounding
Shaun Kaasten
click on a nonrectangular image
#9 Dynamic queries and databases: simple example on Mike
how you can use sliders to build a query to a database Rounding
# 10 The "Bitton" control, beginning guide to building Mike
ActiveX controls a few different ways along with some Rounding
ActiveX explanation
# 11 This program demonstrates dragging and dropping Mike
from explorer and between forms and also includes a Rounding
cool control moving code module. Saul
Greenberg
# 12 This is a stepbystep tutorial for how to integrate Mike
Macromedia Flash into your VB applications. Complete Hornby
with instructions on how to pass information back and Smith
forth and also how to remotely invoke Flash methods
right in VB!
Programs
Project Description Authors
vbHelloWorld A simple hello world program that illustrates a Saul Greenberg
program as a first VB
exercise for students
to do.
http://pages.cpsc.ucalgary.ca/~saul/vb_examples/ 2/7
2/4/2016 Visual Basic Examples
simple sketchpads.
The first one is
only about 6 lines
of code, and just
illustrates some
very basic graphics and event handling. The
second shows how one can dynamically create
controls at run time (the items on the palette),
how controls can be positioned at runtime, and
how controls can be resized when the window
is resized. Its a longer program, but well worth
going through to see how these features work.
See Tutorial 2 for step by step instructions for how
these programs work.
purposes. It illustrates
how to do dynamic
queries on city attributes,
where cities on a map are
filtered immediately as a
person moves a slider or
checks a checkbox. While the example is
simple, the possibilities of how you can
enhance it are endless.
Click on the image to view it in full size.
raises events
vbFlexdata Illustrates a database with the flex control. Shaun Kaasten
vbShapedControls Illustrates how you can clip the shape of Shaun Kaasten
ActiveX Controls
Project Description Author
HelloWorld A tutorial and example project Saul Greenberg
http://pages.cpsc.ucalgary.ca/~saul/vb_examples/ 5/7
2/4/2016 Visual Basic Examples
ActiveX. I include it to
show you how you can do interactive graphics (well, at least
some simple stuff),
how you can make an active x control that you can include in a
project.
To use: Unzip the file into a directory. Check out the test
program in a sub directory that I included. In your own
project, you can include the range slider by going into
project/components and then selecting Browse. Navigate
to the OCX file that will be in the unzipped directory and
select it. You will see a new control that you can select.
PictureClip A tutorial program that shows you how to use Dave Miller,
581 student
the PictureClip component for creating
animations.
ShowNeighbours An activeX control plus exe that shows you how Chris Bradley,
581 student
to find the other controls in a form from inside
an ActiveX control. Saul Greenberg used this
example to build a Mr. Popularity button, where
all the other controls on the form gravitate
towards a Mr Popularity ActiveX button.
xparent.zip Illustrates how you can build a Mike Rounding,
Shaun Kaasten
transparent ActiveX Control
that lets you detect clicks on a
nonrectangular image (in the
figure on the right these would
be the red letters). See Tutorial
8.
tranparent.zip Similar to xparent.zip, except this version Mike Rounding,
http://pages.cpsc.ucalgary.ca/~saul/vb_examples/ 7/7