30.01.2015 Views

the integration of visual basic programming language into physics ...

the integration of visual basic programming language into physics ...

the integration of visual basic programming language into physics ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TextBox3.Text = Nothing<br />

TextBox4.Text = Nothing<br />

TextBox5.Text = Nothing<br />

TextBox6.Text = Nothing<br />

TextBox7.Text = Nothing<br />

End Sub<br />

Now we move on to <strong>the</strong> Save button. We‟ve added an error message to be displayed if <strong>the</strong> user<br />

didn‟t calculate <strong>the</strong> values and wants to save <strong>the</strong> results without doing it: it checks if <strong>the</strong> last Text Box<br />

is empty and if it is <strong>the</strong> error message will be displayed when <strong>the</strong> user clicks on Save, if not it will<br />

move on and write all <strong>the</strong> data <strong>into</strong> an excel table.<br />

For <strong>the</strong> last button we only have to write 2 code lines. First double click on <strong>the</strong> Main Page<br />

button. After writing <strong>the</strong> code, it should look like this [11, 13]:<br />

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)<br />

Handles Button4.Click<br />

Form1.Show()<br />

Me.Close()<br />

End Sub<br />

2.3 Saving <strong>the</strong> program<br />

After you‟re done you want to save <strong>the</strong> application. First you have to build it (go to Build ><br />

Build ~application name~). That will check for any errors made by you in <strong>the</strong> code (Figure 6). If it‟s<br />

all fine it will display “Build succeeded” in <strong>the</strong> lower left corner <strong>of</strong> <strong>the</strong> program.<br />

Figure 6. Building <strong>the</strong> application<br />

If <strong>the</strong>re are no code errors you can move on and save <strong>the</strong> project (Figure 7). It will display<br />

“Item(s) saved” in <strong>the</strong> lower left corner <strong>of</strong> <strong>the</strong> program. If <strong>the</strong>re are errors, Visual Basic will tell you<br />

where to look for.<br />

Figure 7. Saving <strong>the</strong> application<br />

2.4 The final application (<strong>the</strong> final GUI)<br />

The final result is binding all <strong>the</strong> calculators in one interface from which <strong>the</strong>y can be accessed.<br />

In <strong>the</strong> first drop down box <strong>the</strong>re will be displayed a list <strong>of</strong> <strong>the</strong> experimental laboratory projects. The<br />

user will be able to choose <strong>the</strong> desired project. Even more, each project contains two alternative<br />

experimental methods. Corresponding to that, <strong>the</strong> application displays <strong>the</strong> two calculators. Therefore,<br />

Figure 8 presents <strong>the</strong> determination <strong>of</strong> <strong>the</strong> refractive index through <strong>the</strong> alternative method, “The<br />

minimum deviation <strong>of</strong> <strong>the</strong> light”.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!