Page 1
Page 2
Introduction
Ever wish you could control how the standard MsgBox
looks and where its position on the screen? Well this tutorial will offer
you a simple way to create your own substitution for the boring MsgBox
where your imagination is the limit. Very little code is required too.
We will call it MyMsgBox control (real original!).
It is simply implemented as a Subroutine you call just like MsgBox.
---- Start a new Pocket PC eVb project with
a single form.
Set the form property:
Name = frmMain
---- Put the following controls on your form
(pay close attention to the instructions for putting some controls INSIDE
another it's a little tricky if you are not used to it):
Add a frame: This will be the main container
frame for MyMsgBox acting as a background so we can have a colored border
on it. Of course you can experiment with the color and size.
set these properties:
Name = fraMsgBg
BackColor = &H00FF0000&
BorderStyle = 0
(clear the Caption property)
Height = 1665
Visible = False
Width = 2235
(Position it where you want MyMsgBox to show on the form)
Add another frame INSIDE of fraMsgBg:
This will be the base container for the rest of the controls. When you
add this second frame, it will automatically be placed as a child of the
frmMain. You must cut it and paste it into fraMsgBg manually. Do this
by selecting the new frame, Ctrl-X to cut it from the form, select fraMsgBg
then Ctrl-V to place it within fraMsgBg. You will have to do this a few
more times with other controls so be prepared.
set these properties to the new frame:
Name = fraMsgBox
BackColor = &H0080FFFF&
BorderStyle = 0
(clear the Caption property)
(set the font style to Bold)
Height = 1485
Width = 2055
(Position it in the center of fraMsgBg for the border effect)
Your should project should look like this:

Now add two Command buttons INSIDE fraMsgBox
and set their names.
Set one:
Name = cmdOK
Caption = Ok
Set the other one:
Name = cmdCancel
Caption = Cancel
Set both of the buttons:
Height = 255
Width = 615
Position them near the bottom of fraMsgBox - try to
get the Ok button in the center of the frame.
Your should project should look like this:

Finally add a Label control INSIDE fraMsgBox
to house the prompt message. Position it near the top center of fraMsgBox
above the 2 command buttons.
Name = lblMsgPrompt
(clear the Caption property)
Height = 885
Width = 1575
Leave the BackColor to the default, we will change
it to the same BackColor as fraMsgBox at runtime.
Your should project should look like this:

That completes our new customized "control".
Next Page