77范文网 - 专业文章范例文档资料分享平台

codejock英文教程(5)

来源:网络收集 时间:2019-02-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

ActiveX

Programmatically Moving\\Docking an Existing Pane Author: Mike Palmatier Posted: April 26, 2008 Environment:Visual Basic 6.0

Downloads:

movepanesample.zip - Source Files with Demo Project [8 KB]

To programmatically dock a pane, you will need to destroy the pane, then create a new pane, using the CreatePane method to specify the new place to dock the pane.

The instance of the attached form\\object still exists after a pane is destroyed. After you re-create the pane in the desired location you will then attach the form\\object that was previously attached to the old pane to the new pane. If you set up the Attach_Pane event properly you should not have to worry about re-attaching the form\\object to the pane.

The sample code below simply shows how to dock an existing pane to the right side of the application. Please download the sample project for the entire source.

'Dock the pane with Id ID_SEARCH_PANE to the right of 'the application

MoveSearchPane ID_SEARCH_PANE, 200, 200, _

DockingDirection.DockRightOf

'subroutine used to dock a pane to the top, bottom, left, or right 'side of an application

Private Sub MoveSearchPane(PANE_TO_MOVE As Integer, nWidth As _ Integer, nHeight As Integer, _

Optional Direction = DockingDirection.DockLeftOf)

Dim Pane As Pane

Dim sTitle As String

Dim iIconId As Integer

'search for a pane with Id PANE_TO_MOVE

Set Pane = DockingPaneManager.FindPane(PANE_TO_MOVE)

'If a pane with Id PANE_TO_MOVE exists save the Title and 'IconId, then destroy it If Not Pane Is Nothing Then

'save Title

sTitle = Pane.Title

'save IconId

iIconId = Pane.IconId

'Destroy Pane with Id PANE_TO_MOVE. '

'NOTE: The instance of the attached form\\object still 'exists and is not deleted, only the pane DockingPaneManager.DestroyPane Pane End If

'Creates new pane docking it in the new location, when the 'attach_pane event is called (which is the first time the 'pane becomes visible) the old form\\object will get attached 'to the new pane

Set Pane = DockingPaneManager.CreatePane(PANE_TO_MOVE, _ nWidth, nHeight, Direction, Nothing)

'Restore Title and IconId Pane.Title = sTitle Pane.IconId = iIconId

End Sub

Changing the Language for a Component

Author: Mike Palmatier Posted: April 28, 2008

Environment:Visual Basic 6.0

Codejock Components allows you to support multiple languages with only a single line of code. Below are the 32 different languages currently supported: Arabic (Saudi Arabia)

Czech

Finnish

Hebrew

Swedish Thai

Portuguese (Portugal)

Chinese (PRC)

Danish

French (France)

Hungarian

Ukrainian

Dutch

Romanian

Chinese (Taiwan)

English (US)

German (Germany)

Italian (Italy)

Slovenian

Spanish

Croatian

Estonian

Greek

Japanese

Slovakian

Russian

South Korean

Latvian

Lithuanian

Norwegian

Polish

Portuguese (Brazil)

Included with each Codejock component is 32 language resource files. This will translate all static strings that the developer can not change such as the text on the commandbars customize dialog. These files are installed to the \folder. All you need to do is set the ResourceFile property of the component to the name of the resource file you want to use. This should be done in the Form_Initialize event. Private Sub Form_Initialize()

CommandBarsGlobalSettings.ResourceFile = \ DockingPaneGlobalSettings.ResourceFile = \ PropertyGridGlobalSettings.ResourceFile = \ ShortcutBarGlobalSettings.ResourceFile = \ End Sub

Overriding the Default Expand Popup Menu Author: Mike Palmatier Posted: April 28, 2008

Environment:Visual Basic 6.0 Downloads:

CustomExpandButton.zip - Source Files with Demo Project [39 KB]

When the expand button is pressed, the default menu only allows the user to \Buttons\not translated as well. You can create your own popup menu to override the default one in the ExpandButtonDown event. This not only allows you to add your own popup menu, but you can translate the text to the current local. This tutorial will show you how to create an expand menu similar to the one seen in Office 2003.

To start, you must set CancelMenu to True in the ExpandButtonDown event: 'The ExpandButtonDown event is fired when the ShortcutBar's 'expand button is clicked.

Private Sub wndShortcutBar_ExpandButtonDown(CancelMenu As Boolean)

'Cancels the default menu that is displayed when the expand button is pressed. 'The default button only displays the \More Buttons\and \Fewer

'Buttons\ CancelMenu = True

Dim Popup As CommandBar

Dim Control As CommandBarControl Dim SubControl As CommandBarControl Dim i As Long

Dim Item As ShortcutBarItem

In this sample we will use the CommandBars to create our expand menu. So we will need to add any icons to the CommandBars Icons collection.

'Add the icons from the ShortcutBar to the Commandbars to 'be used in the commandbar popup that will be created CommandBars.Icons.AddIcons wndShortcutBar.Icons

Then create a Popup Commandbar that will be used as the ShortcutBar's new expand button popup:

'Creates a popup command bar we will use as the 'ShortcutBar's expand button popup menu

Set Popup = CommandBars.Add(\

Now add some buttons to the popup menu. The picture below shows where these buttons will be displayed:

'Adds buttons to the popup command bar, we will add a total 'of 9 commands With Popup

'Adds the \

Set Control = frmMain.AddButton(.Controls, xtpControlButton, _

SHORTCUT_SHOW_MORE, \Buttons\

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库codejock英文教程(5)在线全文阅读。

codejock英文教程(5).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/478878.html(转载请注明文章来源)
上一篇:-信息提示
下一篇:教书育人 关爱学生
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: