week 5

How to enable a user to print from your Program

I this section we will be reviewing the steps that you need to follow to enable a user to print from your application.

Step 1.
Within the VB.Net application you will need to select the print form option from the printing menu in the visual basic PowerPacks and drag this on to your program window.



Once the feature is added to the bottom bar of the form designer, click on the icon and review the properties window as per the image below



Select the option in print action and set it to "PrinttoPreview"


Clearing a programs text box fileds

In some instances we may need to reset all information that is contained within a programs text boxes, this may occure when a user changes their mind, or when a new user is creating an order. The Code that we use in this instance is.

Dim txt As Control For Each txt In Controls If TypeOf txt Is TextBox Then txt.Text = "" End If Next
#

How to close an application

It may be required at some point in a program to either end the program completely of to close a subwindow of the program that has been opened to provide possible further information, simular to that of a help window. If we needed to close these windows/programs we would need to use the following code.

Close()



5 min's


Checkbox's

The use of checkboxes are usful functions in a program as they have the ability to be set with a defined value that once selected becomes a factor in a possible calculation. This would be useful in area like resturant where an option to go large can be set to add £1.00 more to the cost of a meal. Or in a clothing shop to include a carry bag or to have it gift wrapped as the code below demonstrates.

If GiftWrap.Checked Then dgiftprice = dindgiftwrap * dqty GiftWrapBox.Text = Str(dgiftprice) GiftWrapBox.Text = Format(GiftWrapBox.Text, "Currency") Else dgiftprice = 0.0 GiftWrapBox.Text = Format("0.0", "Currency") End If dtotalprice = dteeprice + dgiftprice TotalPriceBox.Text = Str(dtotalprice) TotalPriceBox.Text = Format(TotalPriceBox.Text, "Currency")


EXTENTION

EXTENTION

STRETCH & CHALLENGE


The information covered in this page covers the knowledge and understanding linked to the criterion in the table below.

Links to Assessment Criteria Description
LO1 Understand the features of event driven programming:
Key features: service oriented; time driven; event handlers; trigger functions; events eg mouse, keyboard, HTML object, form, user interface; event loops; flexibility; suitability for graphical interfaces; simplicity of programming; ease of development
LO2 Be able to use the tools and techniques of an event driven language:
Triggers: eg key press, alarm, system event, touch screen event, mouse click
Tools and techniques: eg use of tool boxes and controls, selection, loops, event handlers, triggers, objects and object properties, menus; debugging tools
Variables: declaring variables; scope of variables; constants; data types
Functional Skills English Reading, Writing, Comprhension, Problems Solving, Nouns
Functional Skills Maths Compression,Reduction
British Values None covered in this session.
Equality and Diversity

Last Updated
2018-04-16 13:27:00

Links to Learning Outcomes

Links to Assessment criteria

 


English

0

Maths







How 2's Coverage

0

0

Files that support this week


| | | | |
Week 4
Prev
Week 5
Prev
Week 6
Prev

Next

Next
Webmaster Spelling Notifications