|
-
Nov 5th, 2000, 03:03 PM
#1
Thread Starter
Frenzied Member
How would you put an image over another image?
I tried a picturebox over another but you saw the square of the object over the form, but I would like to be able to see just the image in front. Also, how do you make a right click menu popup, so that when you right click a text box, you would get a menu where your mouse is that has items that you can specify? Thanks
retired member. Thanks for everything 
-
Nov 5th, 2000, 03:50 PM
#2
_______
<?>
Use an image control with no borders and just load different images when you want to.
Set Image1.Picture = LoadPicture(C:\myfolder\myfile.jpg")
as for the textbox stuff:
Code:
'get rid of popup for text box on right click
'
'<<<<<<<<<< put this in a bas module >>>>>>>>>>>>>>>>>>
'
Option Explicit
Public Declare Function CallWindowProc Lib "user32" _
Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, _
ByVal hWnd As Long, _
ByVal Msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Public Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Public Const GWL_WNDPROC = -4
Public Const WM_RBUTTONUP = &H205
Public lpPrevWndProc As Long
Public lngHWnd As Long
Public Sub Hook(hWnd As Long)
lngHWnd = hWnd
lpPrevWndProc = SetWindowLong(lngHWnd, GWL_WNDPROC, _
AddressOf WindowProc)
End Sub
Public Sub UnHook()
Dim lngReturnValue As Long
lngReturnValue = SetWindowLong(lngHWnd, GWL_WNDPROC, _
lpPrevWndProc)
End Sub
Public Function WindowProc(ByVal hw As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Select Case uMsg
Case WM_RBUTTONUP
'Do nothing
'Or popup your own menu
Case Else
WindowProc = CallWindowProc(lpPrevWndProc, hw, _
uMsg, wParam, lParam)
End Select
End Function
' <<<<<<<<<<<<<<<< form code >>>>>>>>>>>>>>>>>>>>>
'Add the following code to the Form_Load event of the form where the text box is placed:
Call Hook(Text1.hWnd)
'Where Text1 is the name of the text box you want to Subclass.
'Add the following code to the Form_Unload event:
Call UnHook
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|