Vb chapters 11 12
This presentation is the property of its rightful owner.
Sponsored Links
1 / 11

VB Chapters 11 & 12 PowerPoint PPT Presentation


  • 86 Views
  • Uploaded on
  • Presentation posted in: General

VB Chapters 11 & 12. Security panel app chpt 12. Textbox Properties. In the Interest Calculator we have a few new properties Multi-line property set to true ReadOnly set to true Scrollbar set to Vertical. TextBox Methods. inputTextbox.clear( ) inputTextbox.focus( ). Listboxes.

Download Presentation

VB Chapters 11 & 12

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Vb chapters 11 12

VB Chapters 11 & 12

Security panel app chpt 12


Textbox properties

Textbox Properties

In the Interest Calculator we have a few new properties

  • Multi-line property set to true

  • ReadOnly set to true

  • Scrollbar set to Vertical


Textbox methods

TextBox Methods

  • inputTextbox.clear( )

  • inputTextbox.focus( )


Listboxes

Listboxes

  • Allow users to select items from a list

  • Users can add or delete items

  • You must write code to add or remove items from a listbox

  • paymentsListbox.items.clear( )

  • paymentsListbox.items.add(“months” & ControlChars.Tab & “monthly Payments”)

  • gradesListBox.Items.Add(val(inputTextbox.Text))


Hidden code

Hidden Code

  • You’re creating lots of code when you work with the GUI.

  • To see this code click “show All Files” in the solution explorer and then click the + next to the DentalPayment.vb.

  • Double click designer


Select case

Select Case

  • Another option for selection

  • Useful when there are many different options – it is a multiple selection statement

  • Can take the place of layers of nested or stacked ifs. This is much preferred over too many nested ifs

  • The expression following the keywords Select Case is called a controlling expression


Case statements

Case Statements

  • Conditions are checked in the case statements

  • Multiple values tested in a single case statement are separated by a comma

  • Bad Case Statement:

    Case 51 To 30

  • Here the case statement is ignored and may result in a logic error


Case else

Case Else

  • Case Else can be helpful with error checking

  • But be careful where you use it. Using it before any of your Case Statements results in a syntax error


An example

An Example

  • Select Case AccessCode

  • Case Is < 10

  • message = "restricted access"

  • Case 1645 To 1689

  • message = "technitions"

  • Case 8345

  • message = "custodians"

  • Case 9998, 1006 To 1008

  • message = "scientists"

  • Case Else

  • message = "access denied"

  • End Select


Adding stuff to a listbox

Adding Stuff to a Listbox

  • LogEntryListBox.Items.Insert(0, date.now & “ “ & message)


Neat textbox stuff

Neat Textbox Stuff

  • The Text property of textboxes to access user input

  • SecurityCodeTextBox.Clear( )

  • SecurityCodeTextBox.Text &= “2”

  • PasswordChar : setting this property to * masks data enter in the textbox.

  • Can prevent a user from modifying text in a textbox by setting enabled property to “false”


  • Login