The information in this article applies to:
- Microsoft Visual Basic Standard and Enterprise Editions for Windows,
version 5.0
SYMPTOMS
The Microsoft Windows common control keys are case-sensitive and returns an
error if the correct case is not used. The following error will be returned
when the incorrect case is used:
Element not found
CAUSE
The cause of the problem is that the case of the Key is not correct.
RESOLUTION
Enter the proper case for the Key and it will work as expected.
STATUS
This behavior is by design.
MORE INFORMATION
The following steps demonstrate how the keys are case-sensitive in the
Microsoft Common Controls.
Steps to Reproduce Behavior
- Create a new Visual Basic Project. Form1 is created by default.
- From Project Components menu, select Microsoft Common Controls.
- Add the ImageList Control to the form. Right-click the Imagelist
Control, and then select Properties. On the Images tab, choose Insert
a BMP file, type "First" for key value, and then choose Apply.
- Add a Toolbar control. Right-click on Toolbar, and then select
Properties. Select "ImageList1" from the Imagelist dropdown box, and
then choose Apply.
- Click on the Buttons tab, click Insert Button, and then type "Button"
next to Key: and type "first" next to Image: Click on Apply Note:
"Element not found" error returned.
- Type in "First" for image key button, and no error is received. Click
on Apply and BMP appears.
- Double-click the toolbar and enter the following code in the
ButtonClick event:
SELECT CASE Button.Key
Case "button"
MSGBOX "case insensitive"
Case "Button"
MSGBOX "case sensitive"
END SELECT
- Press the F5 key to run the application and click the toolbar and note
that the "Element not found" error message is returned.
|