تبلیغات :
ماهان سرور
آکوستیک ، فوم شانه تخم مرغی ، پنل صداگیر ، یونولیت
فروش آنلاین لباس کودک
خرید فالوور ایرانی
خرید فالوور اینستاگرام
خرید ممبر تلگرام

[ + افزودن آگهی متنی جدید ]




صفحه 2 از 2 اولاول 12
نمايش نتايج 11 به 13 از 13

نام تاپيک: مشکل وحشتناک متفاوت بودن اندازه فرم در مونیتور های مختلف

  1. #11
    در آغاز فعالیت
    تاريخ عضويت
    Jan 2010
    پست ها
    8

    پيش فرض

    سلام در موقع طراحی فرمهات کمترین رزولوشن رو معیار برای کار کردن بقیه قرار بده و خودت هم با همون رزولوشن
    یعنی 1024*768 فرمهات رو تو vb بساز تا بقیه کابرا مشگل نداشته باشن

  2. #12
    داره خودمونی میشه AQOUA's Avatar
    تاريخ عضويت
    Mar 2010
    محل سكونت
    Tehran
    پست ها
    91

    پيش فرض

    با سلام
    آقايون و خانوما شرمنده، ميدونم يكم ديره ولي گفتم بزارم تا شما هم استفاده كنيد.

    Private Sub Form_Load()
    'set the graphics mode of this form to persistent
    Me.AutoRedraw = True
    'start the enumeration
    EnumDisplayMonitors ByVal 0&, ByVal 0&, AddressOf MonitorEnumProc, ByVal 0&
    End Sub
    'in module
    Public Const MONITORINFOF_PRIMARY = &H1
    Public Const MONITOR_DEFAULTTONEAREST = &H2
    Public Const MONITOR_DEFAULTTONULL = &H0
    Public Const MONITOR_DEFAULTTOPRIMARY = &H1
    Public Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
    End Type
    Public Type MONITORINFO
    cbSize As Long
    rcMonitor As RECT
    rcWork As RECT
    dwFlags As Long
    End Type
    Public Type POINT
    x As Long
    y As Long
    End Type
    Public Declare Function GetMonitorInfo Lib "user32.dll" Alias "GetMonitorInfoA" (ByVal hMonitor As Long, ByRef lpmi As MONITORINFO) As Long
    Public Declare Function MonitorFromPoint Lib "user32.dll" (ByVal x As Long, ByVal y As Long, ByVal dwFlags As Long) As Long
    Public Declare Function MonitorFromRect Lib "user32.dll" (ByRef lprc As RECT, ByVal dwFlags As Long) As Long
    Public Declare Function MonitorFromWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal dwFlags As Long) As Long
    Public Declare Function EnumDisplayMonitors Lib "user32.dll" (ByVal hdc As Long, ByRef lprcClip As Any, ByVal lpfnEnum As Long, ByVal dwData As Long) As Long
    Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    Public Function MonitorEnumProc(ByVal hMonitor As Long, ByVal hdcMonitor As Long, lprcMonitor As RECT, ByVal dwData As Long) As Long
    Dim MI As MONITORINFO, R As RECT
    Debug.Print "Moitor handle: " + CStr(hMonitor)
    'initialize the MONITORINFO structure
    MI.cbSize = Len(MI)
    'Get the monitor information of the specified monitor
    GetMonitorInfo hMonitor, MI
    'write some information on teh debug window
    Debug.Print "Monitor Width/Height: " + CStr(MI.rcMonitor.Right - MI.rcMonitor.Left) + "x" + CStr(MI.rcMonitor.Bottom - MI.rcMonitor.Top)
    Debug.Print "Primary monitor: " + CStr(CBool(MI.dwFlags = MONITORINFOF_PRIMARY))
    'check whether Form1 is located on this monitor
    If MonitorFromWindow(Form1.hwnd, MONITOR_DEFAULTTONEAREST) = hMonitor Then
    Debug.Print "Form1 is located on this monitor"
    End If
    'heck whether the point (0, 0) lies within the bounds of this monitor
    If MonitorFromPoint(0, 0, MONITOR_DEFAULTTONEAREST) = hMonitor Then
    Debug.Print "The point (0, 0) lies wihthin the range of this monitor..."
    End If
    'check whether Form1 is located on this monitor
    GetWindowRect Form1.hwnd, R
    If MonitorFromRect(R, MONITOR_DEFAULTTONEAREST) = hMonitor Then
    Debug.Print "The rectangle of Form1 lies within this monitor"
    End If
    Debug.Print ""
    'Continue enumeration
    MonitorEnumProc = 1
    End Function

    thanks



  3. این کاربر از AQOUA بخاطر این مطلب مفید تشکر کرده است


  4. #13
    آخر فروم باز keb's Avatar
    تاريخ عضويت
    Nov 2009
    محل سكونت
    ...رو به رو سراب ... پشت سر خراب..
    پست ها
    1,443

    پيش فرض

    بیا اینم یه برنامه کاری از خودم:
    http://kianel.persiangig.com/Mouse%20move.exe با این برنامه میتونی مختصات رو بدست بیاری.

صفحه 2 از 2 اولاول 12

Thread Information

Users Browsing this Thread

هم اکنون 1 کاربر در حال مشاهده این تاپیک میباشد. (0 کاربر عضو شده و 1 مهمان)

User Tag List

قوانين ايجاد تاپيک در انجمن

  • شما نمی توانید تاپیک ایحاد کنید
  • شما نمی توانید پاسخی ارسال کنید
  • شما نمی توانید فایل پیوست کنید
  • شما نمی توانید پاسخ خود را ویرایش کنید
  •