Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    [VB6.0] IMPOSTAZIONI SCHERMO

    CIAO,
    vorrei sapere come impostare con VB6.0 la risoluzione dello schermo (es: 1280 x 1024)

    GRAZIE!

  2. #2
    Fai una ricerca nel Forum, è un argomento trattato molteplici volte..

    ciao

  3. #3
    ciao,

    ho trovato alcuni argomenti interessanti, ma da quanto ho capinto screen.height(o width) e screen.twipperx(o twippery) sono proprietà di sola letture: facendo le proporzioni tra queste trovo la risoluzione dello schermo, ma non riesco a cambiarla!!!!

    grazie, ciao

  4. #4
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,463
    Prova a leggere questa.

    Ciao!
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

  5. #5
    grazie

    ma quando clicco su "www.it.lang etc...." mi esce un errore: THE PAGE CANNOT BE FOUND, che credo voglia dire "la pagina non è stata trovata...."

    grazie comunque per l'aiuto...

  6. #6
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,463
    Questa è una soluzione pubblicata da Francesco Balena su DevX:
    codice:
    Option Explicit
    
    Const DM_BITSPERPEL As Long = &H40000
    Const DM_PELSWIDTH As Long = &H80000
    Const DM_PELSHEIGHT As Long = &H100000
    Const CDS_FORCE As Long = &H80000000
    
    Const CCDEVICENAME As Long = 32
    Const CCFORMNAME As Long = 32
    
    Private Type DEVMODE
        dmDeviceName As String * CCDEVICENAME
        dmSpecVersion As Integer
        dmDriverVersion As Integer
        dmSize As Integer
        dmDriverExtra As Integer
        dmFields As Long
        dmOrientation As Integer
        dmPaperSize As Integer
        dmPaperLength As Integer
        dmPaperWidth As Integer
        dmScale As Integer
        dmCopies As Integer
        dmDefaultSource As Integer
        dmPrintQuality As Integer
        dmColor As Integer
        dmDuplex As Integer
        dmYResolution As Integer
        dmTTOption As Integer
        dmCollate As Integer
        dmFormName As String * CCFORMNAME
        dmUnusedPadding As Integer
        dmBitsPerPel As Long
        dmPelsWidth As Long
        dmPelsHeight As Long
        dmDisplayFlags As Long
        dmDisplayFrequency As Long
    End Type
    Private Declare Function EnumDisplaySettings Lib "user32" Alias _
        "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, _
        ByVal modeIndex As Long, lpDevMode As Any) As Boolean
    Private Declare Function ChangeDisplaySettings Lib "user32" Alias _
        "ChangeDisplaySettingsA" (lpDevMode As Any, ByVal dwflags As Long) As Long
    
    ' change the screen resolution mode
    '
    ' returns True if the requested resolution mode is among those
    ' supported by the display adapter (otherwise it doesn't even
    ' try to change the screen resolution)
    
    Function ChangeScreenResolution(ByVal Width As Long, ByVal Height As Long, _
        ByVal NumColors As Long, Optional Frequency As Long) As Boolean
        Dim lpDevMode As DEVMODE
        Dim index As Long
        
        ' set the DEVMODE flags and structure size
        lpDevMode.dmSize = Len(lpDevMode)
        lpDevMode.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT Or DM_BITSPERPEL
        
        ' retrieve info on the Nth display mode, exit if no more
        Do While EnumDisplaySettings(0, index, lpDevMode) > 0
            ' check whether this is the mode we're looking for
            If lpDevMode.dmPelsWidth = Width And lpDevMode.dmPelsHeight = Height _
                And 2 ^ lpDevMode.dmBitsPerPel = NumColors Then
                ' check that the frequency is also the one we're looking for
                If Frequency = 0 Or Frequency = lpDevMode.dmDisplayFrequency Then
                    ' try changing the resolution
                    If ChangeDisplaySettings(lpDevMode, CDS_FORCE) = 0 Then
                        ' zero means success
                        ChangeScreenResolution = True
                        Exit Do
                    End If
                End If
            End If
            ' skip to next screen mode
            index = index + 1
        Loop
    
    End Function
    Prova a vedere se può fare al caso tuo.

    Ciao!
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.