Home » » Menambahkan Icon Pada Menu Editor VB
| 26 komentar ]

Bagi Anda yang baru belajar VB dan masih menggunakan Menu Editor untuk membuat menu tentu merasa kesulitan untuk menambahkan icon di menu tersebut, karena memang G ada fasilitasnya :D .
Tapi jangan kuatir setelah meluangkan waktu beberapa menit untuk membaca artikel ini maka Anda akan dengan mudah menambahkan icon pada menu standar VB.

Berikut langkah-langkahnya :
1. Buat menu seperti biasanya menggunakan Menu Editor
2. Download komponen vbAccelerator VB6 PopMenu Control ekstrak kemudian copykan ke file tersebut ke folder Windows\System32. Setelah itu ketik perintah berikut dari Start -Run

1regsvr32 cpopmenu6.ocx
3. Tambahkan komponen (CTRL + T) berikut :
  • Micrososft Windows Common Control 6.0 (SP6)
  • vbAccelerator VB6 PopMenu Control – bla bla bla

4. Masukkan kedua komponen tersebut ke form



khusus untuk komponen ImageList tambahkan beberapa icon dan jangan lupa mengeset keynya



5. Terakhir bagian kode, tambahkan fungsi dan prosedur berikut :

01 Private Function getIconIndex(ByVal key As String) As Long
02     getIconIndex = ImageList1.ListImages.Item(key).Index - 1
03 End Function
04
05 Private Sub setIcon(ByVal key As String, ByVal menuName As String)
06    Dim iconIndex As Long
07
08    iconIndex = getIconIndex(key)
09    PopMenu1.ItemIcon(menuName) = iconIndex
10 End Sub

Kemudian tinggal tambahkan kode di event Form_Load seperti berikut :
01Private Sub Form_Load()
02    With PopMenu1
03        .ImageList = ImageList1
04        .OfficeXpStyle = True
05        .SubClassMenu Me
06
07        Call setIcon("new", "mnuNew")
08        Call setIcon("open", "mnuOpen")
09        Call setIcon("close", "mnuClose")
10        Call setIcon("save", "mnuSave")
11        Call setIcon("preview", "mnuPrintPreview")
12        Call setIcon("print", "mnuPrint")
13        Call setIcon("mail", "mnuMailRecipient")
14        Call setIcon("fax", "mnuFaxRecipient")
15        Call setIcon("powerpoint", "mnuMicrosoftPowerPoint")
16     End With
17End Sub

Jalankan program (F5) Anda akan mendapatkan hasil seperti berikut :


Sample program bisa Anda download disini.
Selamat mencoba :)

Share |

Artikel Terkait :



26 komentar

LabQ5 mengatakan... @ 14 November 2011 23.09

"vbAccelerator VB6 PopMenu Control" free ga nih??

Abramz mengatakan... @ 17 Maret 2012 02.39

vbAccelerator VB6 PopMenu Control gak bisa running di win 7 ya bro? -_-
install ocx dah success padahal
"activeX component can't create object"
kira2 kenapa ya bro?

Anonim mengatakan... @ 17 Desember 2012 17.23

Wonderful work! That is the type of info that should be shared around the net.
Shame on the seek engines for no longer positioning this submit upper!
Come on over and discuss with my site . Thank you =)
My web site: sci-fi book blog

Anonim mengatakan... @ 18 Desember 2012 15.22

It's a shame you don't have a donate button! I'd definitely donate to this excellent blog! I suppose for now i'll settle for bookmarking and adding your RSS feed to my Google account.

I look forward to new updates and will talk about this website with my Facebook group.
Chat soon!
Also visit my web site ; Buy Targeted Facebook Likes

Anonim mengatakan... @ 18 Desember 2012 18.09

Pretty component of content. I simply stumbled upon your site and in accession
capital to claim that I get actually loved account your weblog posts.
Any way I will be subscribing to your feeds or even I success you get right of entry to
persistently quickly.
my web site > electronic cigarette wholesale

Anonim mengatakan... @ 19 Desember 2012 03.32

Great website. Lots of helpful information here. I am sending it to some friends ans
additionally sharing in delicious. And certainly, thanks to your sweat!
My webpage :: Credit Repair Reviews

Anonim mengatakan... @ 17 Januari 2013 08.31

I am regular reader, how are you everybody? This post posted at
this website is in fact fastidious.
my web page: The Tao of Badass Review

Anonim mengatakan... @ 30 Januari 2013 06.43

It's an awesome article in favor of all the online users; they will obtain benefit from it I am sure.
Also visit my page - myplaces.co.nz

Anonim mengatakan... @ 18 Februari 2013 14.51

This paragraph is genuinely a good one it assists
new web people, who are wishing for blogging.

Also visit my blog: grand-jewelry

Anonim mengatakan... @ 22 Mei 2013 23.44

Hey! Do you use Twitter? I'd like to follow you if that would be okay. I'm definitely enjoying
your blog and look forward to new posts.

Feel free to visit my web blog sexygirlchat

Anonim mengatakan... @ 23 Mei 2013 02.43

Hey there! This post could not be written any better!
Reading through this post reminds me of my good
old room mate! He always kept talking about this.
I will forward this write-up to him. Pretty sure he will have a
good read. Many thanks for sharing!

Also visit my blog: xxx sucking

Anonim mengatakan... @ 23 Mei 2013 05.00

Hey I know this is off topic but I was wondering if you knew of any
widgets I could add to my blog that automatically tweet my newest twitter updates.
I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

My website :: happy ending massage bali

Anonim mengatakan... @ 23 Mei 2013 07.04

Thanks for finally talking about > "Menambahkan Icon Pada Menu Editor VB" < Loved it!

Also visit my web-site - real party porn

Anonim mengatakan... @ 2 Juni 2013 12.33

Excellent article. Keep writing such kind of information on your blog.
Im really impressed by your blog.
Hi there, You've performed an incredible job. I'll
definitely digg it and individually suggest to my friends.
I'm confident they will be benefited from this website.

Also visit my web page; milf movie site

Anonim mengatakan... @ 3 Juni 2013 03.58

Please let me know if you're looking for a article writer for your weblog. You have some really good posts and I feel I would be a good asset. If you ever want to take some of the load off, I'd love to write some content for your blog in exchange for
a link back to mine. Please send me an email if
interested. Many thanks!

my homepage: teen girls anal

Anonim mengatakan... @ 4 Juni 2013 04.06

I like the valuable info you provide in your articles.
I will bookmark your blog and check again here regularly.
I'm quite certain I will learn a lot of new stuff right here! Good luck for the next!

Here is my page: http://www.cfnmfever.net/videos/the-party-gets-wild-66/

Anonim mengatakan... @ 20 Juni 2013 20.44

udah di download, tapi pas dicoba ngak bisa, error "ActiveX ... error",

Ronny mengatakan... @ 12 Juli 2013 07.42

udahh w download jga, system operasi punya w yg 64 bit, gmna yak caranya.???

finestglasses mengatakan... @ 18 Februari 2014 22.44

you will be provided with eye drops and area around reading glasses your eyes will be washed properly
http://www.finestglasses.com/reading-glasses.html

Anonim mengatakan... @ 7 Maret 2014 16.46

You don need do anything but click here to get free prescription glasses. I believe you never have such a great chance to get free glasses. Hurry up.

Anonim mengatakan... @ 28 November 2014 00.30

e cigarette, electronic cigarette starter kit, electronic cigarette, e cigarette, e cig forum, e cigarette forum

sherry jiang mengatakan... @ 3 Maret 2015 18.42

Imagine a beautiful room that draws gasps of appreciation when people enter the room. If you are thinking of your living room, adjust your perspective and take a mental walk to your shower http://www.plumpinguk.co.uk/showers.html. A shower has endless possibilities to make a statement and ensure an invigorating wash every day.

dc Z mengatakan... @ 14 Agustus 2015 00.04

Achat en ligne pour Bricolage un vaste choix de Robinets de bain, Robinets de douche, Systèmes baignoire & douche de plus à prix bas tous les jours.http://www.robinetso.fr/9-robinet-de-douche

Zhu Y mengatakan... @ 17 Agustus 2015 20.14

We pneumatic products manufacture several products, including solenoid valves,air control valves, piston air cylinder, Pneumatic Air Filter and some pneumatic accessories. Most of goods are exported to USA, Europe and Asia. And they are widely used on electronic, pharmaceutical, food processing, packaging, medical and automotive industries. Visit: www.xinyipneumatic.com

Ilham Quicker mengatakan... @ 11 April 2016 20.54

kenapa koq ndak bisa didownload

Amy Carry mengatakan... @ 16 Oktober 2016 20.25

With the http://www.faucetsmarket.com/antique-faucets-c-1.html coming in many different formats, it is easy to find a solution that works for you. Installing an Kitchen faucet Light KitA simple way to add LED lighting to your kitchen without spending a lot of money is to use an Bathroom mirror light kit.

Poskan Komentar

Recent Reader

GET UPDATE VIA EMAIL
Dapatkan artikel terbaru langsung ke email anda!