掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
shapeコントロールをマウスで動かすには? (ID:117263)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
やりたい順序で紙に書くとわかりやすいですよ 設計書というより手順書という感覚で どういうプログラムでダブルクリックで飛ぶのか不明ですけど以下ロジック Private mblnRes As Boolean Private mlngX As Long Private mlngY As Long Private Sub Form_Load() mblnRes = False End Sub Private Sub Form_MouseDown(〜省略〜) Dim lngRight As Long Dim lngBottom As Long lngRight = Shape1.Left + Shape1.Width lngBottom = Shape1.Top + Shape1.Height If X >= Shape1.Left And X <= Shape1.Right _ Y >= Shape1.Top And Y <= Shape1.Bottom Then mlngX = Shape1.Left - X mlngY = Shape1.Top - Y mblnRes = True End If End Sub Private Sub Form_MouseMove(〜省略〜) If mblnRes = True Then If X <= Me.ScaleWidth And Y <= Me.ScaleHeight If X >= 0 And Y >= 0 then Shape1.Move X + mlngX, Y + mlngY Enf If Enf If Enf If End Sub Private Sub Form_MouseUp(〜省略〜) mblnRes = False End Sub こんなんでどうでしょうか?
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.