Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User form - Picture in the caption?

Is there a way to put a picture, like bitmap, in the caption in a use
form?

/Ol

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default User form - Picture in the caption?

/Ola;
Yes there is, but that is very very difficult.
I've only seen that once.

Check Stephen Bullens site :

http://www.bmsltd.co.uk/Excel/Default.htm

en download formfun.zip.

Then look at the code and think again if you don't know what it means.

Succes;
Mark.

More Excel ? www.rosenkrantz.nl or
--------------------------------------------------------------------

"Ola " wrote in message
...
Is there a way to put a picture, like bitmap, in the caption in a user
form?

/Ola


---
Message posted from
http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default User form - Picture in the caption?

"Mark Rosenkrantz" wrote in message ...
/Ola;
Yes there is, but that is very very difficult.
I've only seen that once.

Check Stephen Bullens site :

http://www.bmsltd.co.uk/Excel/Default.htm

en download formfun.zip.

Then look at the code and think again if you don't know what it means.

Succes;
Mark.

More Excel ? www.rosenkrantz.nl or
--------------------------------------------------------------------

"Ola " wrote in message
...
Is there a way to put a picture, like bitmap, in the caption in a user
form?

/Ola


---
Message posted from
http://www.ExcelForum.com/


It isn't that differcult
Just put an Image control with an Icon in it either on a sheet or the
Userfrom
and run this code...
Assumes Picture control is called ImgIcon

Option Explicit

Private Declare Function SendMessage _
Lib "user32" _
Alias "SendMessageA" ( _
ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
LParam As Any) _
As Long

Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Const WM_SETICON = &H80
Private Const ICON_SMALL = 0&
Private Const ICON_BIG = 1&

Dim hWnd As Long

'// Draw from Userform
Private Sub CommandButton1_Click()
hWnd = FindWindow(vbNullString, UserForm2.Caption)

Call SendMessage(hWnd, WM_SETICON, ICON_SMALL, ByVal
ImgIcon.Picture.Handle)
Call SendMessage(hWnd, WM_SETICON, ICON_BIG, ByVal
ImgIcon.Picture.Handle)

End Sub
'// Draw from Sheet
Private Sub CommandButton2_Click()
hWnd = FindWindow(vbNullString, UserForm2.Caption)

Call SendMessage(hWnd, WM_SETICON, ICON_SMALL, ByVal
Sheet2.Image1.Picture.Handle)
Call SendMessage(hWnd, WM_SETICON, ICON_BIG, ByVal
Sheet2.Image1.Picture.Handle)

End Sub

The above calls it from commandbuttons ... just amend to call from
initialize event.....
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I add a caption to a picture in Excel SooDesuNe Excel Discussion (Misc queries) 4 November 15th 07 05:29 PM
User Form Picture mully New Users to Excel 3 May 23rd 05 08:32 PM
picture in caption?? RUSTYDK85 Excel Discussion (Misc queries) 1 May 10th 05 07:25 AM
Form Caption Logo, How? WTG Excel Worksheet Functions 0 February 27th 05 01:40 PM
Excel VBA - User form caption problem xlnoobie Excel Programming 2 February 7th 04 06:21 PM


All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"