|
-
Jun 8th, 2000, 07:12 PM
#1
Hi again guys,
I can't find a post related to this yet, but does anyone of you guys know how to create an icon?? well, i mean, putting images into the command buttons. I don't mean, creating a image then put in "image_click", just simply a command button with images on it.
thanks guy
-
Jun 8th, 2000, 07:21 PM
#2
Lively Member
To put images onto a toolbar button you have to add the imagelist control. You then load all of your images using the insert button. Once you have the images loaded you can then call the imagelist from all most any other control. Hope this helps.
-
Jun 8th, 2000, 07:29 PM
#3
erm. sorry.. but where can I find the Imagelist control???
-
Jun 8th, 2000, 07:42 PM
#4
Addicted Member
It's on Microsoft Common Controls 6-2, I think.
-
Jun 8th, 2000, 07:44 PM
#5
transcendental analytic
Press Ctrl+T Search for the Microsoft Windows Common controls and check it, press ok, the three boxes on each other is the imagelistcontrol
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 8th, 2000, 09:22 PM
#6
thanks guys..
got it working
-
Jun 8th, 2000, 09:53 PM
#7
_______
At design time set the command button sytle to 1 (graphical)
then add the picture via the picture property.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 9th, 2000, 02:53 AM
#8
It'll be better to make your own button using an Image Control. I find that the normal ones are too large when a picture is added.
-
Jun 9th, 2000, 02:47 PM
#9
HeSaidIT
i have to agree, HeSaidJoe's method is the most simplest, no hassle. But, u would have to create this images urself to ensure the size you wanted.
-
Jun 9th, 2000, 04:56 PM
#10
PowerPoster
DrawIcon API?
How about this?
Code:
Option Explicit
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command2_Click()
Dim Path$, strSave$, MyDC&, return1&
'String Buffer
strSave = String(200, Chr$(0))
'GetRegEDIT Path
Path = Left$(strSave, GetWindowsDirectory(strSave, Len(strSave))) + "\REGEdit.exe"
return1& = ExtractIcon(Me.hwnd, Path, 3)
MyDC = GetDC(Command1.hwnd)
'Draw the icon on the CommandButton
return1 = DrawIcon(MyDC, 0, 0, return1)
End Sub
-
Jun 9th, 2000, 11:02 PM
#11
Yeah that works good, but it covers up the Caption. I suppose, though, that it would be good if you did not want any text of it (Ie, a Toolbar button)
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
|