CorelDraw X6宏使用DTPicker控件插入日期 [英] CorelDraw X6 Macro to insert Date using DTPicker Control

查看:81
本文介绍了CorelDraw X6宏使用DTPicker控件插入日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在标签中插入日期.我写了下面的代码.我可以通过单击箭头来选择日期,然后弹出日历.取消"按钮正在工作,但是当我单击确定"时,无法将其插入标签.标签是带有文本和图像的常规Corel文档.我尝试插入矩形工具箱,以查看是否可以使用X,Y坐标在其中插入日期,但这没有用.我基本上需要知道如何在标签上插入 DTPicker.Value .

I'm trying to insert a date into a label. I have written the following code. I can select a date by clicking on the arrow and the calendar pops up. The "CANCEL" button is working, but when I click "OK" I cannot get it to insert on the label. The label is a regular Corel document with text and images. I tried inserting a rectangle toolbox to see if I can get it to insert the date in there by using X,Y coordinates but that didn't work. I basically need to know how to insert DTPicker.Value onto the label.

Sub ShowIt()
    Calendar.Show
End Sub

Private Sub Cancel_Click()
    Unload Me
End Sub

Private Sub OK_Click()
    a = DTPicker1.Value
    b = Format(DTPicker1.Value, "mm/dd/yy")
    Unload Me
End Sub

Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
    DTPicker1.Value = Format(DTPicker1.Value, "mm/dd/yy")
End Sub

Private Sub Calendar_Activate()
    Me.DTPicker1.Value = Date    
End Sub

谢谢!

推荐答案

以下代码应按要求工作:

The below code should work as requested :

ActiveDocument.ReferencePoint = cdrCenter

XPos = Activeselection.PositionX 'XPos of the rect

YPos = Activeselection.PositionY 'YPos of the rect

Set s = ActiveLayer.CreateArtisticText(0, 0, CStr(Date))

s.PositionX=XPos

s.PositionY=YPos

但是:他没有使用Corel Draw ..... :)
https://community.coreldrawdraw.com/talk/coreldraw_community/f/101/t/51007

BUT : He did not use Corel Draw..... :)
https://community.coreldraw.com/talk/coreldraw_community/f/101/t/51007

这篇关于CorelDraw X6宏使用DTPicker控件插入日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆