Ribbon Foxpro dengan codejock

langsung aja yaa

capture

naa cara pengunaanya kita pake ocx dari codejock, bisa cari digoogle deh,

pertama, registrasi dulu ocxnya via run administrator, pastikan juga file .lic dalam 1 folder

kedua, pada form drag drop objectnya

capture

ketiga, bikin method dalam form kasih nama misalkan createribbon, sintaknya


Public TabWrite As RibbonTab, GroupFont As RibbonGroup, Control As CommandBarControl
Public GroupClipborad As RibbonGroup, ControlPopup As CommandBarPopup

Public RibbonBar As RibbonBar
RibbonBar = Thisform.CommandBars.AddRibbonBar("Ribbon Bar")

RibbonBar.EnableDocking(1)

Public ControlFile As CommandBarPopup
ControlFile = RibbonBar.Controls.Add(2, -1, "&File", 1)
With ControlFile.CommandBar.Controls
.Add(1, 11, "&New")
.Add(1, 12, "&Open...")
Control = .Add(1, 13, "E&xit")
Control.BeginGroup = .T.
Endwith
*/Menu 1
TabWrite = RibbonBar.InsertTab(0, "Menu Master")
*/SubMenu 1.1
GroupClipborad = TabWrite.Groups.AddGroup("Tabel Referensi",1)
ControlPaste = GroupClipborad.Add(4, 111, "Ref Buku")
ControlPaste.CommandBar.Controls.Add(1, 112, "Ref Guru")
ControlPaste.CommandBar.Controls.Add(1, 113, "Ref Kelas")
GroupClipborad.Add(1,114, "Ref Buku")
GroupClipborad.Add(1, 115, "Ref Buku Lagi")
Control = GroupClipborad.Add(1, 116, "Ref Kelas Lagi")
Control.Enabled =.F.

*/SubMenu 1.2
GroupFont = TabWrite.Groups.AddGroup("&Font",1)
GroupFont.Add(1, 211, "Color")
Control = GroupFont.Add(1, 212, "&Bold")
Control.BeginGroup = .T.
GroupFont.Add(1, 213, "&Italic")
GroupFont.Add(1, 214, "&Underline")
Control = GroupFont.Add(1, 215, "Strikethrough")
Control.Enabled = .F.
Control = GroupFont.Add(1, 216, "Subscript")
Control.Enabled = .F.
Control = GroupFont.Add(1, 217, "Superscript")
Control.Enabled = .F.

*/ Menu 2
TabInsert = RibbonBar.InsertTab(1, "&Insert")
*/SubMenu 2.1
GroupPages = TabInsert.Groups.AddGroup("&Pages",1)
ControlNew = GroupPages.Add(4, 100, "&New Page")
ControlNew.CommandBar.Controls.Add( 1, 101, "&Blank Page")
ControlNew.CommandBar.Controls.Add (1, 108, "&Save Selection as New Page")
ControlCover = GroupPages.Add(4, 108, "Cover Page")
ControlCover.DescriptionText = "Insert a fully-formatted cover page. You fill in the title, author, date, and other information."
ControlCover.CommandBar.Controls.Add (1, 108, "&Remove Current Cover Page")
ControlCover.CommandBar.Controls.Add (1, 108, "&Save Selectio as New Cover Page")
GroupPages.Add(1, 111, "Page Break")

*/SubMenu 2.2
GroupTable = TabInsert.Groups.AddGroup("&Table",2)
ControlTable = GroupTable.Add(3, 108, "&Table")
ControlTable.CommandBar.Controls.Add( 1, 108, "&Inset Table..")
ControlTable.CommandBar.Controls.Add (1, 108, "Dra&w Table")
ControlTable.CommandBar.Controls.Add (1, 108, "Con&vert Text to Table...")
Tabwrite.Selected = .T.

Thisform.Loadicon

naa disana ada sintax .Add( 1, 101, “&Blank Page”), yang mana 1 adalah xtpButtonDropDown, bisa dlihat di object browser

capture

sedangkan 101 adalah id, parameter selanjutnya adalah nama/caption menunya,ok

keempat, cara menambahkan icon di menu, tambahakn method dengan nama loadicon, sintaknya


thisform.CommandBars.Options.UseSharedImageList = .F.
thisform.CommandBars.Icons.LoadIcon("E:\cobacoba\MenuBar\GroupPopup.ico",11,0)
thisform.CommandBars.Icons.LoadIcon("E:\cobacoba\MenuBar\menu.ico",211,0)

penjelasanya singkatnya Icons.LoadIcon(“E:\cobacoba\MenuBar\GroupPopup.ico”,11,0) parameter pertama itu pathnya icon, parameter kedua, id menu yang tadi, sedangkan 0 adalah  xtpImageNormal silahkan cek di object browser

kelimat, untuk execute jika kita klik menu, terletak di method execute yang ada di object commandbarcapture

naa control.id, id disana adalah id yang ada di button menu nya jadi sesuaikan saja kawan😀

klo mau sampelnya silahkan https://www.mediafire.com/?p5mwi58wr8sujp6 , HANYA UNTUK PEMBELAJARAN SAJA , SILAHKAN BELI PRODUKNYA http://www.codejock.com/

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: