VB利用CS9的TkxOleCtrlEx.ocx控件,驱动打印机,实现自动打印
'OCX
'OCX (Object component exchange) is an ActiveX control.
'An OCX is an Object Linking and Embedding (OLE) custom control, a special-purpose program that can be created for use by applications running on Microsoft's Windows systems. OCXs provide such functions as handling scroll bar movement and window resizing.
'Microsoft now calls an OCX an ActiveX control, the component object under Microsoft's set of ActiveX technologies, of which the fundamental concept is the Component Object Model (COM) and, in a network, the Distributed Component Object Model (DCOM).
'An OCX or ActiveX control is actually implemented as a dynamic link library DLL module. (You can think of a DLL program as a "subprogram" that can be used by any number of application programs, each of which is a "container" for the DLL or OCX/ActiveX control "object.") Visual Basic and C++ are commonly used to write OCX or ActiveX controls.
'利用TkxOleCtrlEx.ocx控件实现打印,需要安装CS9,VB中才能添加TkxOleCtrlEx.ocx部件
Private Sub Command2_Click()
Me.TkxOleCtrlEx1.ShowDialog lppxPrinterSetupDialog, 0 '打印机设置
End Sub
Private Sub Command3_Click()
Dim Printers As Variant
Dim Name As Variant
Dim Msg As String
printes = Me.TkxOleCtrlEx1.Printers(lppxAllPrinters) '选择打印机
For nindex = LBound(Printers, 1) To UBound(Printers, 1)
Msg = Msg + Printers(nindex) + vbCrLf
Next
MsgBox Msg
Dim Variables As Variant
Variables = Me.TkxOleCtrlEx1.Variables(lppxAllDataSource) '获取CS9模板里设置的变量
For Index = LBound(Variables, 1) To UBound(Variables, 1)
Msg = Msg + Variables(nindex, 0) + "=" + Variables(nindex, 1) + vbCrLf '得到模板里设置的变量名和变量值
Next
MsgBox Msg
Variables(0, 1) = "变量1"
Me.TkxOleCtrlEx1.DocumentName = "c:\tmp.lab" '获取模板文件路径
Me.TkxOleCtrlEx1.UpdateVariables Variables '为变量赋值
Me.TkxOleCtrlEx1.PrintDocument (1) '打印label
End Sub
利用VB自制OCX控件利用VB自制OCX控件隐藏>> 利用VB 自制 OCX 控件如今 OCX 控件在编程中已占领了很重要的地位,我们可以利用 OCX 控件完成一些相当 复杂的编程操作...
VB制作OCX控件的步骤_计算机软件及应用_IT/计算机_专业资料。VB制作OCX控件的步骤 2010-12-18 22:07:54 分类: 【VB&编程】 下面列出制作OCX控件的步骤: 一:...
VB OCX制作_IT/计算机_专业资料。VB编程OCX控件制作第14章 ActiveX 部件 ActiveX部件是由ActiveX技术创建的、一个或多个对象所组成的、 可以重复使用的编程代码和数...
在VB中利用控件实现条形码批量打印_IT/计算机_专业资料。维普资讯 http://www.cqvip.com ? 4 0? CoptrEr . 04mue aNo820 在V B中利 用控 件 实现 条形码...
VB工程里植入OCX控件_建筑/土木_工程科技_专业资料。VB工程里植入OCX控件做法...VB利用CodeSoft9的OCX控... 暂无评价 1页 1下载券 VB表格控件说明(celltex....
VB工程里植入OCX控件_IT/计算机_专业资料。许多VB工程文件移植到别的电脑上会出现OCX控件缺失的问题,本文介绍了如何将OCX文件植入到工程文件,这样不论换哪台电脑,...
在VB中利用控件实现条形码批量打印_IT/计算机_专业资料。条形码作为一种识别技术,由于快速、准确、方便等优点,被广泛应用于各行业。本文介绍了使用MICROSOFT条形码控件...
现在我们可以利用 VB5.0 方便的制作出自己的 OCX 控件供我们在编程中使用同时还可以把它送给你周围 喜欢编程的朋友! 下面列出制作 OCX 控件的步骤: 一:新建 ...
第七章 VB高级控件 ActiveX控件:采用ActiveX技术创建的一个或多个对象组成,是一段可重复使 用的程序代码和数据。以文件形式存在,扩展名为.ocx ActiveX控件添加: ...
OCX控件在WINDOWS XP中的注册方式_计算机软件及应用_IT/计算机_专业资料。OCX控件...如:在 VC++中开发的 ActiveX 控件,不作任何修改即可应用于 VB 中。由此可见...
热门文档