Home » » Menambahkan Icon Pada Menu Editor VB
| 23 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 :



23 komentar

Muhamad Iqbal mengatakan... @ 14 November 2011 pukul 23.09

"vbAccelerator VB6 PopMenu Control" free ga nih??

Abramz mengatakan... @ 17 Maret 2012 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 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 pukul 20.44

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

Ronny mengatakan... @ 12 Juli 2013 pukul 07.42

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

Andy Gregory mengatakan... @ 18 Februari 2014 pukul 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... @ 28 November 2014 pukul 00.30

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

Unknown mengatakan... @ 3 Maret 2015 pukul 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.

Unknown mengatakan... @ 11 April 2016 pukul 20.54

kenapa koq ndak bisa didownload

memet mengatakan... @ 17 September 2018 pukul 19.32

pas d jalanin d comp lain failed to load imagelist ..... gtu
kenapa ya

Posting Komentar

Recent Reader