国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
ppt中拖圖

 

 

 

 

建議將宏的安全級(jí)別設(shè)置為低。

 

1.新建一個(gè)ppt空白文檔。

 

2.點(diǎn)擊菜單:“工具——宏——宏”,出現(xiàn)對(duì)話框。

 

3.對(duì)話框中“宏名”隨意寫個(gè),比如:move,再點(diǎn)“創(chuàng)建”,就進(jìn)入代碼模式。

 

4.刪去所有的代碼,把下面的代碼全拷貝進(jìn)去。

 

 

 

Option Explicit

Declare Function GetKeyState Lib"user32" (ByVal nVirtKey As Long) As Integer

Private Declare Function WindowFromPointLib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long

Private Declare Function GetWindowRect Lib"user32" (ByVal hwnd As Long, lpRect As RECT) As Long

Private Declare Function GetCursorPos Lib"user32" (lpPoint As PointAPI) As Long

Private Declare Function SetCursorPos Lib"user32" (ByVal x As Long, ByVal y As Long) As Long

Public Declare Function MonitorFromPointLib "user32.dll" (ByVal x As Long, ByVal y As Long, ByVal dwFlags AsLong) As Long

Private Declare Function GetSystemMetricsLib "user32" (ByVal nIndex As Long) As Long

Private Const SM_SCREENX = 0

Private Const SM_SCREENY = 1

Private Const sigProc = "Drag &Drop"

Public Const VK_SHIFT = &H10

Public Const VK_CTRL = &H11

Public Const VK_ALT = &H12

Private Type PointAPI

    xAs Long

    yAs Long

End Type

Public Type RECT

   Left As Long

   Top As Long

   Right As Long

   Bottom As Long

End Type

Public mPoint As PointAPI, dPoint AsPointAPI

Public ActiveShape As Shape

Dim dragMode As Boolean

Dim dx As Double, dy As Double

Sub DragandDrop(sh As Shape)

dragMode = Not dragMode

If dragMode Then Drag sh

End Sub

Private Sub Drag(sh As Shape)

Dim i As Integer, sx As Integer, sy AsInteger

Dim mWnd As Long, WR As RECT

dx = GetSystemMetrics(SM_SCREENX): dPoint.x= dx

dy = GetSystemMetrics(SM_SCREENY): dPoint.y= dy

GetCursorPos mPoint

With ActivePresentation.SlideShowWindow

   mWnd = WindowFromPoint(mPoint.x, mPoint.y)

   GetWindowRect mWnd, WR

   sx = WR.Left

   sy = WR.Top

   dx = (WR.Right - WR.Left) / ActivePresentation.PageSetup.SlideWidth

   dy = (WR.Bottom - WR.Top) / ActivePresentation.PageSetup.SlideHeight

End With

If dx > dy Then

   sx = sx + (dx - dy) * ActivePresentation.PageSetup.SlideWidth / 2

    dx = dy

 End If

 If dy > dx Then

   sy = sy + (dy - dx) * ActivePresentation.PageSetup.SlideHeight / 2

    dy = dx

End If

While dragMode

   GetCursorPos mPoint

   sh.Left = (mPoint.x - sx) / dx - sh.Width / 2

    sh.Top= (mPoint.y - sy) / dy - sh.Height / 2

   DoEvents

    i= i + 1: If i > 2000 Then dragMode = False: Exit Sub

Wend

End Sub

5.點(diǎn)擊保存后,關(guān)閉代碼模式,回到ppt設(shè)計(jì)頁面。在你需要拖動(dòng)的圖片上點(diǎn)右鍵,選擇“放映-動(dòng)作設(shè)置——單擊鼠標(biāo)——運(yùn)行宏——確定”。

 

6.放映幻燈片,看看效果吧。

 

優(yōu)點(diǎn):可視性強(qiáng)。

 

缺點(diǎn):對(duì)于PPT新手來說不易操作。

三、VBA編輯

 

建議將宏的安全級(jí)別設(shè)置為低

 

1.在演示文稿插入圖像控件(視圖——工具欄——控件工具箱),打開屬性窗口,將picture設(shè)成你想拖動(dòng)的圖片(這里注意圖片大小要合適哦),遺憾的是Image控件不支持透明。

 

2.雙擊圖像控件,打開的VBA編輯窗口(注意雙擊后先刪除所有代碼),復(fù)制下面的代碼:

 

 

Dim X1, Y1 As Integer

 DimDown As Boolean

 Private Sub Image1_MouseDown(ByVal Button AsInteger, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

 IfNot Down Then

 X1 =X

 Y1 =Y

 Down= True

 EndIf

 EndSub

 Private Sub Image1_MouseMove(ByVal Button AsInteger, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

 IfDown Then

 Image1.Left = Image1.Left + X - X1

 Image1.Top = Image1.Top + Y - Y1

 X1 =X

 Y1 =Y

 EndIf

 EndSub

 Private Sub Image1_MouseUp(ByVal Button AsInteger, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

 Down= False

 SlideShowWindows(1).View.First

 EndSub

 

3.保存,關(guān)閉VBA編輯窗口,放映幻燈片,即可看效果了。

 

4.如果你想拖動(dòng)多張圖片,如法炮制,復(fù)制上面的三個(gè)鼠標(biāo)事件,修改Image1X1、Y1。

 

優(yōu)點(diǎn):可視性強(qiáng)。

 

缺點(diǎn):對(duì)于PPT新手來說不易操作。

對(duì)比第二種和第三種方法,在效果上并不太一樣。

 

第二種方法實(shí)現(xiàn)的效果是:你在圖片上單擊鼠標(biāo),放開后,圖片就隨你鼠標(biāo)移動(dòng),如果你再單擊鼠標(biāo),圖片就停在你單擊的地方。

 

第三種方法實(shí)現(xiàn)的效果是:你在圖片上單擊鼠標(biāo),并且要長(zhǎng)按住,這樣圖片才會(huì)隨你鼠標(biāo)移動(dòng),放開后,圖片就停在你放開的地方。

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
如?何在vba中用mouse_event操作鼠標(biāo)?
教你如何設(shè)置讓Excel窗口總是在最前面,保證登錄后才可以做其它事
?LeetCode刷題實(shí)戰(zhàn)223:矩形面積
空間點(diǎn)到直線垂足坐標(biāo)的解算方法
請(qǐng)問如何屏蔽掉VB窗口中的最大化按鈕
VB - 播放WAV文件
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服