您的位置: 首页-> 电脑文摘-> 数据库类-> PowerBuilder-> 正文

在PowerBuilder中调用ChooseColor函数
作者佚名 来源InterNet 加入时间:2005-1-31
首先创建一个Custom user object并定义如下Structure(OS_ChooseColor):

long lstructsize
ulong hwndowner
ulong hinstance
long rgbresult
blob lpcustcolors
long flags
long lcustdata
long lpfnhook
long lptemplatename

定义实例变量:
Private:

os_ChooseColor istr_ChooseColor
long il_CustomInitColors[16]
blob{64} ibl_CustomColors

定义外部函数::

function boolean ChooseColorA( REF os_ChooseColor lpcc ) library "comdlg32.dll"

在 constructor 事件中写入如下代码::


// initialize choosecolor information
// convert the default custom color array to a blob variable blobedit(ibl_customcolors,1,il_custominitcolors)

// let the structure element point to the blob array
istr_choosecolor.lpcustcolors = ibl_customcolors

// set the size
istr_choosecolor.lStructSize = 36

// no owner
SetNull(istr_choosecolor.hwndOwner)

// set flag
istr_choosecolor.flags = 1

创建对象函数:boolean of_choosecolor(ref long al_rgbresult) ,代码如下:

boolean lb_ok
istr_ChooseColor.rgbresult = al_rgbresult
lb_ok = ChooseColorA ( istr_choosecolor )
al_rgbresult = istr_ChooseColor.rgbresult
return lb_ok


[文章录入员:nancy]

相关文章
  • 浅析PowerBuilder下动态SQL语句
  • 在powerbuilder中向Excel传递数据
  • 在powerbuilder中使下拉列表框可以和数据关联
  • PowerBuilder连接Sybase SQL Server的注意事项
  • PowerBuilder编程技巧四则
  • 用Powerbuilder开发WEB数据库
  • 利用POWERBUILDER开发数据库的WEB查询
  • PowerBuilder中实现数据窗口打印预览通用方法
  • 怎样用PowerBuilder开发WEB应用
  • PowerBuilder制作IE风格的图标按钮
  • 相关软件:
  • PowerBuilder系列讲座
  • PowerBuilder 6.0用户参考手册
  • PowerBuilder 7.0
  • ::PCBOOKCN'ADS::


    ::PowerBuilder::
    ACCESS
    MS SQL
    MySQL
    Oracle
    Foxpro
    PowerBuilder
    Sybase
    其它
    ::阅读排行::
    ·浅析PowerBuilder下动...
    ·PowerBuilder连接Sy...
    ·用Powerbuilder开发W...
    ·在powerbuilder中向E...
    ·PB中读取地磅BCD解码
    ·PB通过OLEObject使用W...
    ·在PowerBuilder中操作...
    ·PB动态报表格式自由定义的实现
    ·PB开发Sybase数据库应用技...
    ·如何在PB中制作特殊形状数据窗口...