May 19, 1999

Refresh Component Displays

When you create the visual components that make up a user interface, their size and position are usually constant. However, it’s sometimes necessary to change a component’s size or position dynamically based on some user action. For example, your application may change the text in a label that is already

Validate Users’ Selections in Drop-Downs

Question: I have two drop-down menus. How do I set a validation on my page so that users cannot go all the way to the server if they don’t select something in both drop-down boxes? Here is the code I’ve been working with: Vessels Select a vessel: Select type of

Linking Radio Buttons to Objects

Question: I have a page with two drop-downs and two corresponding radio buttons. When I choose an item from one drop-down, I’d like the corresponding radio button to become checked. The drop-downs are actually ActiveX controls (ActiveCalendar 2.0) and have several events associated with them (onchange, onlostfocus, and so on).

Microsoft FrontPage Server Extensions

Question: I built a Web site for my company using FrontPage 98 and can not seem to upload it back to the Internet. I get error messages about server extensions. What is the problem? I have AOL and use PrimeHost as our Internet Service Provider (ISP). Answer: FrontPage uses code

Testing COM Interfaces at Run Time

VB5 provides interface inheritance through the use of the Implements keyword. For example, CFullTimeEmployee can implement the IEmployee interface. This interface might include basic information such as name, social security number, and date of birth. Another class, CPartTimeEmployee can also implement the IEmployee interface. You can then write code against

Using Label Control as Splitter

Here’s a demo for using a Label control as a splitter between two controls, as well as sample code for employing the splitter in an Explorer-like application: Option ExplicitPrivate mbResizing As Boolean ‘flag to indicate whether mouse left ‘button is pressed downPrivate Sub Form_Load() TreeView1.Move 0, 0, Me.ScaleWidth / 3,

Always Use Case Else With Select Case

Select Case statements can lead to errors when the test expression in the Select Case line doesn’t yield a true result for any of its individual Case expressions. Therefore, you should always use a Case Else as the final Case within a Select Case statement. This sample raises a custom

Quicker Textbox Additions

Consider these two examples of code that add a string to a textbox. Example 1: Text1.text = Text1.text & MyString Text1.SelStart = Len(Text1.text) Example 2: Text1.SelStart = Len(Text1.text) Text1.SelText = MyString In the first example, you must copy the complete text from the textbox into a separate buffer to perform

Use Windowless Controls for Performance and Economy

VB6 comes with an ActiveX control named MSWLESS.ocx (“Microsoft Windowless Controls 6.0”), which contains lightweight equivalents for these standard controls: WLTextWLFrameWLCommandWLCheckWLOptionWLComboWLListWLHScrollWHVScroll The controls have lower resource consumption than their regular counterparts, as well as better performance. Because they don’t have windows, they don’t have handles or DDE capability, and they

No more posts to show