|
-
May 17th, 2000, 10:27 PM
#1
Thread Starter
New Member
Hi
Ok could someone please tell me how to get a files icon onto a command button, there must be a way you can do this, iv looked everywere for some code but i cant find any.
Please help!!!!
Thanks
-
May 17th, 2000, 11:20 PM
#2
Fanatic Member
-
May 17th, 2000, 11:32 PM
#3
Hyperactive Member
Isn't there a graphical setting on the command button? If not, kinjalgp is right about the picture box. It does the same thing.
bob
-
May 18th, 2000, 12:14 AM
#4
transcendental analytic
You can change its style to graphical an you'll be able to show the pictures
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.
-
May 18th, 2000, 01:30 AM
#5
Lively Member
add Microsoft Forms 2.0 object library to component reference.
fm20.dll
Now it gives another command button to which you can assign pictures and text.
Ramdas
-
May 18th, 2000, 07:27 AM
#6
THANK YOU SO MUCH, I DID NOT KNOW THAT....
this is awesome, thank you, I would have never figured that out.... that form dll thing is awesome, even if it is another dll you have to distribute, THANK YOU
-
May 18th, 2000, 08:43 AM
#7
Thread Starter
New Member
NO
I am wanting the user to be able to ad any file icon to the command button
So it takes the icon from the file and then adds it to the button
-
May 18th, 2000, 10:43 AM
#8
transcendental analytic
For getting the icon out of the file and draw it on a DC:
Code:
'In declarations:
Declare Function ExtractIconEx Lib "shell32" Alias "ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Long, phIconLarge As Long, phIconSmall As Long, ByVal nIcons As Long) As Long
Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hicon As Long) As Long
'In code:
Function GetIconsFromFile(Filename$)
Dim hIcons()
ReDim hIcons(ExtractIconEx(Filename, -1, ByVal 0&, ByVal 0&, 0))
If UBound(hIcons) = 0 Then Exit Function Else ReDim Preserve hIcons(UBound(hIcons) - 1)
ExtractIconEx Filename, 0, hIcons(0), ByVal 0&, 10
GetIconsFromFile = hIcons
End Function
'example:
Dim hicon&()
hicon = GetIconsFromFile(yourfilename)
DrawIcon yourdc&, 0, 0, hicon
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.
-
May 18th, 2000, 11:11 AM
#9
Member
Experts? Even i know this one.... But Kedaman is way outa my league..
BTW hey Kedaman ever find that VB3 code you were goin to get 4 me?
-Jeff
Using VB 6.0 Enterprise
I Still like to program on my TI-85!
-
May 18th, 2000, 06:33 PM
#10
transcendental analytic
What was it about? Sorry, I forget easily.
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.
-
May 19th, 2000, 07:19 AM
#11
Member
well i asked you if you could help me find a way to get my program to know any new window that came up. So if i clicked on "My Computer" the textbox #1 would show "My Computer".......You gave me a VB6 code but since that didnt work on my Vb3 you said that you would find it 4 me.
Is it still possible?
-Jeff
Using VB 6.0 Enterprise
I Still like to program on my TI-85!
-
May 19th, 2000, 05:25 PM
#12
transcendental analytic
Yeah, btw i have vb5 not 6. I'll search for it
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.
-
May 20th, 2000, 07:03 AM
#13
Junior Member
I agree with kinjalgp!
after you use kedaman's Code for retrieving the ICOn , then just use Picturebox control to immitate a Command button, go into the Picture Box's Clikc event, set the width and height of the picture to decrease by a small value, creating the click Simulation,,
I know you prob wont use this advice but i jsut poseted it cuz i need more posts in my Credits as i am still a damn Juniour member!!., Heh!
-
May 22nd, 2000, 05:45 AM
#14
Lively Member
Easy. All ya gotta do is push somebody into it.
Hmph. Place an image control directly over the command button. Then use the LoadPicture command to load whatever the user wants to the image. I clarify:
***********************
* _______ .
*| | .
*| Image | Button .
*|_______| .
* .
.......................
My kingdom of a @#$%-ing image tag...
Anyway, use a right-click -> Bring To Front to get the image in front of the button. Just make sure your text doesn't land under the picture.
-
May 22nd, 2000, 04:37 PM
#15
Fanatic Member
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
|