1 / 6

2c – Textboxes and Buttons

Learn about the properties and events of textboxes and buttons in VB.NET programming. Discover how to take user input, set maximum length, display password input, and handle button click events.

gputnam
Download Presentation

2c – Textboxes and Buttons

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2c – Textboxes and Buttons CSCI N331 VB .NET Programming Lingma Acheson Department of Computer and Information Science, IUPUI

  2. Textboxes • Takes user’s text input • Properties: • Name: txtYyyyy • Text: the value inside of the textbox • MaxLength: the maximum number of character users can enter • PasswordChar: character to display for password input • ReadOnly: the value cannot be changed

  3. Buttons • For users to click and let something happen • Properties • Name: btnYyyyy • Text: the text on the button • Button click event - an even that will happen when the button is clicked.

  4. Buttons • To define an event (what should happen when the button is clicked?) • Double clicking on the button on the design page will take you to the source code page. • The event frame work is created automatically. • You only need to fill in event details in the frame work, between “Private Sub buttonName_Click( …” and “End Sub”

  5. Others • MessageBox.Show() – used to create a pop-up message box to display some information. Whatever defined inside the () will show on the message box. • Me – the current form, a handy way to find object names or tasks • Blue wavy line on the code page – something is not right yet, either the statement is not finished or there is an error. Must make it go away before you run the program.

  6. Others • String concatenation sign “&” – connect short texts(strings) together to form a longer text. E.g. “Your name is “ & “Bob.” will become “Your name is Bob.”. Space inside the double quotes will be interpreted as spaces.

More Related