ComponentOne ToolBar for ASP.NET AJAX: Upload for ASP.NET AJAX Task-Based Help > Displaying ToolTips for C1Upload's Buttons

Displaying ToolTips for C1Upload's Buttons

This topic demonstrates how to create custom ToolTips for the button elements of your C1Upload control. When the AddFileButtonToolTip, CancelButtonToolTip, or the UploadButtonToolTip properties are set to a string, users will be able to see a brief description of the page by hovering over it with their cursor. In this topic, you will create a ToolTip for the Add File button and Upload button in Design view, in Source view, and in code.

Adding a ToolTip to the Button Elements in Design View

To add a ToolTip to the button elements, follow these steps:

1.   In Design view, right-click the C1Upload control to open its context menu and then select Properties.

The Properties window opens with C1Upload’s properties in focus.

2.   Locate the AddFileButtonToolTip property and notice the string is set to “Choose a file to add” Change this to read to “Choose a file to add to the file window of the C1Upload control.”

3.   Locate the UploadButtonToolTip property and notice the string is set to “Upload the selected files”. Change this property and enter “Upload the selected files that appear in the file windows of the C1Upload control”.

4.   Press F5 to build your project.

Adding a ToolTip to the Button Elements through Source View

To add a ToolTip in the source file, add AddFileButtonToolTip="Choose a file to add to the file window of the C1Upload control." and UploadButtonToolTip="Upload the selected files that appear in the file windows of the C1Upload control.” to the <cc1:C1Upload> tags. Your HTML will resemble the following:

 

<cc1:C1Upload ID="C1Upload1" runat="server"

            AddFileButtonToolTip="Choose a file to add to the file window of the C1Upload control."

            UploadButtonToolTip="Upload the selected files that appear in the file windows of the C1Upload control."

            Width="250px" />

Adding a ToolTip to the Button Elements in Code

To add tooltips to the button elements, follow these steps:

1.   Import the following namespace into your project:

      Visual Basic

Imports C1.Web.UI.Controls.C1Upload

      C#

using C1.Web.UI.Controls.C1Upload;

2.   Create the tooltips for the button elements by adding the following code to the Page_Load event:

      Visual Basic

C1Upload.AddFileButtonToolTip="Choose a file to add to the file window of the C1Upload control."

C1Upload.UploadButtonToolTip="Upload the selected files that appear in the file windows of the C1Upload control."

      C#

C1Upload.AddFileButtonToolTip="Choose a file to add to the file window of the C1Upload control.";

C1Upload.UploadButtonToolTip="Upload the selected files that appear in the file windows of the C1Upload control.";

This task illustrates the following:

Using the tooltip properties, you can easily create custom tooltips that will appear when your users mouse over C1Upload’s button elements. This image below shows result of the updated AddFileButtonToolTip property:

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.