|
|
![]() | |
|
|
|
To access the contents, click the chapter and section titles.
Visual Basic 6 Black Book
Adding Tables To DHTML PagesOne popular HTML element is the table. Tables can present data in tabular form, but savvy HTML programmers use them for much more. They use tables to format the elements in a Web page, placing those elements at locations they want by inserting them into a tablefor example, you can add sidebars and format image placement with hidden tables. Although the dynamic HTML position attribute helps you place HTML elements where you want them, that attribute is not yet supported by all browsers. To add a table to a DHTML page, you use the Table Operation drop-down box that you see in Figure 21.8. To insert a table, use the Insert Table entry in that drop-down box. When you do, the Page Designer adds a 2×2 table to the page. To add a row, select the Insert Row entry in the Table Operation drop-down box; to add a column, select the Insert Column entry.
As an example, weve added a 3×3 table to our Web page, as shown in Figure 21.8. To add text to each cell in the table, just position the insertion point there with the mouse and type the text you want. Adding Hyperlinks To DHTML PagesTo add a hyperlink to a DHTML page, you use the Hyperlink tool in the DHTML Page Designers toolbox, which is the sixth tool down on the right in Figure 21.9. When you double-click the Hyperlink tool, a hyperlink object is added to the Web page with the caption Hyperlink1. Move that hyperlink to the location you want in the Web page, and change its caption to the text you want simply by changing the text in the hyperlink object directly (just click the hyperlink and type the text as you would in any word processor).
To set the hyperlinks target URL, right-click the hyperlink and select the Properties item in the menu that opens. Next, place the target URL in the box labeled link, as shown in Figure 21.10.
Heres the code that the Page Designer adds to our Web page for our hyperlink: <P>Heres a hyperlink: <A href="http://www.microsoft.com" id=Hyperlink11 name=Hyperlink1>Microsoft </A> </P> Thats itto run the Web page, select the DHTMLProject Properties item in the Project menu, clicking the Debugging tab in the Properties pages that open. Make sure the Start Component option button is clicked and the start component is set to DHTMLPage1, then click on OK. Now select the Start item in the Run menu to open the Web page, as shown in Figure 21.11. As you can see, our new Web page is a success.
Using MAPI Controls To Support EmailThe testing department is calling again. How about adding email capabilities to your new program, SuperDuperDataCrunch? Why? you ask. If nothing else, they say, it can provide an automatic way for the user to register their new program. Hmm, you thinkhow do you add email to a program? You use the MAPI (Messaging Applications Programming Interface) controls that come with Visual Basic.
There are two MAPI controls, the MAPISession control and the MAPIMessages control. To add these controls to a program, follow these steps:
You use the MAPISession control to open a new MAPI session, which is the first step to sending or receiving email, and the MAPIMessages control lets you compose, send, and examine downloaded messages. The MAPIMessages control is the primary control you use in your code (the MAPISession control is only used to connect to the Inbox). To work with the MAPIMessages control, you keep track of two buffers, the read buffer and the compose buffer. The read buffer is made up of a set of messages read from a users Inbox. The MsgIndex property is used to address individual messages within this set, starting with a value of 0 for the first message and incrementing by one for each message. You get the actual emails text from the controls MsgNoteText property. Messages can be created or edited in the compose buffer. The compose buffer is automatically set as the active buffer when the MsgIndex property is set to -1. The MAPIMessages controls message set is built with the Fetch method. This set includes all messages of type specified by the FetchMsgType property and is sorted as indicated by the FetchSorted property. (Previously read messages can be included or left out of the message set with the FetchUnreadOnly property.) Messages in the read buffer cant be altered by the user but can be copied to the compose buffer for alteration using the Copy method. You can see an overview of the MAPIMessages controls methods in Table 21.1, and its properties appear in Table 21.2. Well put this control to work in the following few topics.
|
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |