我的mouse_down不工作。郁闷

解决方案 »

  1.   

    你是说mouse_down事件不产生?不会吧!
      

  2.   

    这是我的form1.frm文件。确实是不工作的。真郁闷啊。
    VERSION 5.00
    Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
    Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
    Begin VB.Form FormTMPlayer 
       BorderStyle     =   0  'None
       ClientHeight    =   7065
       ClientLeft      =   795
       ClientTop       =   1440
       ClientWidth     =   11130
       ControlBox      =   0   'False
       Icon            =   "Form1.frx":0000
       KeyPreview      =   -1  'True
       LinkTopic       =   "Form1"
       ScaleHeight     =   7065
       ScaleWidth      =   11130
       WindowState     =   2  'Maximized
       Begin MSComDlg.CommonDialog CommonDialogOpen 
          Left            =   600
          Top             =   0
          _ExtentX        =   847
          _ExtentY        =   847
          _Version        =   393216
       End
       Begin SHDocVwCtl.WebBrowser WebBrowserTMPlayer 
          Height          =   6135
          Left            =   480
          TabIndex        =   0
          Top             =   480
          Width           =   10335
          ExtentX         =   18230
          ExtentY         =   10821
          ViewMode        =   0
          Offline         =   0
          Silent          =   0
          RegisterAsBrowser=   0
          RegisterAsDropTarget=   1
          AutoArrange     =   0   'False
          NoClientEdge    =   0   'False
          AlignLeft       =   0   'False
          NoWebView       =   0   'False
          HideFileNames   =   0   'False
          SingleClick     =   0   'False
          SingleSelection =   0   'False
          NoFolders       =   0   'False
          Transparent     =   0   'False
          ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
          Location        =   "http:///"
       End
       Begin VB.Image ImageBg 
          Height          =   300
          Left            =   0
          Picture         =   "Form1.frx":0E42
          Stretch         =   -1  'True
          Top             =   0
          Width           =   300
       End
       Begin VB.Menu mnuPopup 
          Caption         =   ""
          Visible         =   0   'False
          Begin VB.Menu mnuOpen 
             Caption         =   "打开"
          End
          Begin VB.Menu mnuQuit 
             Caption         =   "退出"
          End
       End
    End
    Attribute VB_Name = "FormTMPlayer"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Option Explicit
    Private Function ResizeTheForm()    If Screen.Width / 15 < 800 Or Screen.Height / 15 < 600 Then
            MsgBox ("你的屏幕分辨率不满足要求,系统退出")
            End
        End If
        
        FormTMPlayer.Top = 0
        FormTMPlayer.Left = 0
        
        FormTMPlayer.Height = Screen.Height
        FormTMPlayer.Width = Screen.Width
        
        WebBrowserTMPlayer.Height = 580 * 15
        WebBrowserTMPlayer.Width = 780 * 15
        
        WebBrowserTMPlayer.Top = (FormTMPlayer.Height - WebBrowserTMPlayer.Height) / 2
        WebBrowserTMPlayer.Left = (FormTMPlayer.Width - WebBrowserTMPlayer.Width) / 2End FunctionPrivate Function SetBackGround()
        'ImageBg.Picture = LoadPicture(ReadIniData("fasdf", "main", "background"))
        ImageBg.Move 0, 0, ScaleWidth, ScaleHeight
    End Function
    Private Sub Form_Load()
        ResizeTheForm
    End SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        MsgBox X
    End SubPrivate Sub Form_Resize()
        SetBackGround
    End Sub
      

  3.   

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    MsgBox X & "," & Y
    End Sub
      

  4.   

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        MsgBox X
    End Sub我的什么问题么?
      

  5.   

    ImageBg.Move 0, 0, ScaleWidth, ScaleHeight-----------------------------你的没什么,关键是你的form上面有个image
    你用ImageBg_mousedown好了
      

  6.   

    MouseDown不工作没有关系,不是还有MouseMove和MouseUp吗,这两个也可以用的呀。
      

  7.   

    同意flyingscv(zlj)观点你的鼠标点到image上了,没点在窗体上,当然不会触发form_mousedown事件