Compaq iPAQ h3760 Datenblatt Seite 12

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 75
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 11
ENEE408G Fall 2003 (Update 09/23/2003)
Mobile Computing and Pocket PC Programming
11
5. Add More Components to A Project
In this section, we continue with the previous RGB example to explain how to add
various components in eVB. We will move the functions implemented by buttons to
menu items, create a simple text editor, and learn how to open and save files.
(a) Create a new Pocket PC project. From Project
Æ
Components, check the Pocket
PC MenuBar Control 3.0, Microsoft CE File System Control 3.0, and Microsoft
CE Image Control 3.0. Then click OK.
(b) Double click the MenuBar and File in the Toolbox and they will appear in the
Form window. It doesn’t matter where those components locate since they will
be invisible during runtime. We set their Names as “MenuBar1” and “File1”,
respectively.
(c) Set properties for the components created according to table below.
Component Name Caption/Text Visible Scrollbars
ImageCtl ImageCtl1 True
commandButton bnSave Save False
Label Label1 File name with path False
TextBox Text1 “” False 2-vbVertical
TextBox Text2 “” False 0-vbSBNone
Set both Width and Height of ImageCtl1 and Text1 as 2400, and Top and Left as
1080 and 600, respectively. In other words, we make these two components
overlap with each other. Put the Label1, Text2, and bnSave in the upper, middle
and lower part of the form, respectively. Don’t worry about their overlapping
with the ImageCtl1 and TextBox, since they work in different occasion and some
of them will be set to invisible.
(d) After finishing the layout, let’s work on the codes for MenuBar control first. We
will create two dropmenus. One is for the RGB used in the previous example and
the other is for the text editor. As shown in the following figure, we initially set
the RGB part visible and the text editor invisible.
Option Explicit
Private Sub Form_Load()
Dim mnuDropMenu As MenuBarLib.MenuBarMenu
Set mnuDropMenu = MenuBar1.Controls.AddMenu("Colors", "mnuColors")
mnuDropMenu.Items.Add , "mnuColorsR", "Red"
mnuDropMenu.Items.Add , "mnuColorsG", "Green"
mnuDropMenu.Items.Add , "mnuColorsB", "Blue"
mnuDropMenu.Items.Add , , , mbrMenuSeparator
mnuDropMenu.Items.Add , "mnuColorsO", "Flower"
Set mnuDropMenu = MenuBar1.Controls.AddMenu("Text", "mnuText")
mnuDropMenu.Items.Add , "mnuSave", "Save"
Seitenansicht 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 74 75

Kommentare zu diesen Handbüchern

Keine Kommentare