对不起,有点错误刚才
在你print的时候,用变量保存这一行字符串的位置矩形。
例如picturebox or form
private dim Sx as long ,Sy as long ,Cx as long ,Cy as long 字符串位置的矩形变量
放在模块或窗体的最前面
with picturebox1
.currentx=Sx
.currentY=Sy
picturebox1.print StrYourSTring'必须要有picturebox1
cx=sx+.textwidth(stryourstring)
cy=sy+.textheight(stryourstring)
end with
在picturebox的mousedown事件中添加代码
private sub picturebox1_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single)
select case button
case 2'鼠标右键
if x>sx and x<cx and y>sy and y<cy then
popupmenu YourpopUpMEnu
end if
end select
在你print的时候,用变量保存这一行字符串的位置矩形。
例如printbox or form
private dim Sx as long ,Sy as long ,Cx as long ,Cy as long 字符串位置的矩形变量
放在模块或窗体的最前面
with picturebox1
.currentx=Sx
.currentY=Sy
.print StrYourSTring
cx=sx+.textwidth(stryourstring)
cy=sy+.textheight(stryourstring)
end with
在picturebox的mousedown事件中添加代码
private sub picturebox1_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single)
select case button
case 2'鼠标右键
if x>sx and x<cx and y>sy and y<cy then
popupmenu YourpopUpMEnu
end if
end select