Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996



Application Security Testing: An Integral Part of DevOps

Creating Public Methods vs. Using Show Directly

The program I am writing has two menu items for displaying say, autoexec.bat and config.sys respectively. I would like to make it so that they only need to call a form which contains a rich text box to display the files, but I didn't know how to tell the form what file to display upon invoking it (using show method) from the two menus.

Actually, since you're using VB 4.0, you can create a public method on your form that can be used instead of the Show method. For instance: In the file display form:

Public Sub ShowFile(sFilename as String)
   Me.Show   ' will display form
   ' Code to load file into text box or whatever goes here

End Sub
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date