home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code1
/
no_move
/
nomove.frm
(
.txt
)
next >
Wrap
Visual Basic Form
|
1993-09-06
|
9KB
|
114 lines
Form1
Form11
Image1
Image1
Label1
Label1
MS Sans Serif
Image1
CloseMain_Click
Form_Load<
CloseMain
Visible
Image1_Click
popup
CloseSub3
Image1
Height+
CloseSub_Click
CaptionX
Form2
Loadr
mnuClose
Form1
mnuMain
ACTIVE_TITLE_BAR
TITLE_BAR_TEXT{
Label1
ForeColor
BackColor
Label1_Click
Widthq
ScaleWidth^
Alignment
FontName
FontSize
Screen
TwipsPerPixelX
TwipsPerPixelY
Form_Resize
Form_Click
WindowStateh
Image1_DblClick
shown
Image1_MouseDown
Indexv
Button
Shift
Picture
Form_KeyPress
keyAscii
Form_GotFocus5
SavedHeight
SavedTop
Image1_MouseUpA
MouseX
MouseY
resizing
KeyPreview(
Form_KeyUpK
KeyCode
ALT_MASK
KEY_F4
KEY_SPACE
Value
required to re-adjust form height
after caption is added or removed
required to re-adjust form toph
evaluates mouse coordinates to determine if popup should pop up.
Form_KeyUp
this sub allows the user to access the system menu
by keying Alt+Space, or to close the form by keying Alt+F4..
Form_Load
This project is in response to a question posed by another MSBASICS
forum member: "How can I create a nonmovable window which still has
a control box, title bar and minimize button?"
This project demonstrates the creation of a form which cannote
be moved by the user, even though it has a control menu and
title bar. This is achieved by simulating the control menu and
title bar with an image and a label. I didn't address the minimize
button since that can be faked with a bitmap. I simply added thez
minimize option to the popup menu.
There are two forms in this project; Form1 is visible with no menu,a
while the invisible Form2 contains a menu for popup use by Form1.u
Form_Load sets up the visible form, which contains
Image1 to hold the control menu bitmap, and label1, whichn
simulates the title bar. When the user clicks Image1, a e
popup menu is shown using a menu from the hidden Form2..
After Form1 is minimized there is no control menu which appears when
the icon is clicked, but a double-click still restores it.
THIS IS A BIG KLUGE JOB and I don't guarantee that it's the best
solution. I merely got bitten by the 'figure it out if you can' bug.
I hope this is helpful and informative, at the least. If you have any
questions, please feel free to email me!
Barry Seymour
Marquette Computer Consultantse
CIS 70413,3405u
setup Form1...
position Image1
position, setup Label1
System
centered
Unmovable Form Demo
form-level var
form-level varm
don't show it.t
Form_Resize
form was just restored. Clear it's caption and ensure
it's correctly sized and positioned. (Required because
form height & Top change when caption is removed)c
Image1_Click
Yields the popup menun
Image1_DblClick
closes the program