🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #2363

Re: Risoluzione Video

#2363
From: Genesio Conti
Date: Mon, 09 Jun 2003 16:45
37 lines
2315 bytes
"Pino" <peppeca@tiscali.it> ha scritto nel messaggio
news:bc0b5u$d14$1@lacerta.tiscalinet.it...
> Da poco mi sono affacciato a Visual Basic e tra i vari problemi che mi si
> sono presentati nel realizzare un piccolo programmino,c'� quello della
> dimensione del Form in base alla risoluzione video.
>
> Qualcuno mi sa dire se c'� modo,scrivendolo nel codice di adattare i form
> automaticamente alle varie risoluzioni video che gli utenti hanno sui
> computer?

Dunque :
Screen.Width = larghezza in twips dello schermo;
Screen.Height = altezza;

Tieni presente che i valori sono espressi in twips. Per sapere quanti twips
ci sono per ogni pixel
Screen.TwipsPerPixelX e Screen.TwipsPerPixelY.

Se imposti
esempio:
Form1.ScaleMode = vbPixels, oppure dalla finestra Propriet� del form, la
propriet� ScaleMode a vbPixels,
poi trovi la risoluzione dello schermo, ed imposti l'altezza e la larghezza
in base ai valori calcolati.
Esempio
Sub MostraRisoluzione()
    Dim X as single, Y as single
    X = Screen.width / Screen.TwipsPerPixelX
    Y = Screen.Height / Screen.TwipsPerPixelY
    Msgbox "La tua risoluzione � di " & X & " x " & Y & " pixels"
end sub

Cmq c'� sempre la bella propriet� WindowState = Maximized...

Saluti
Genesio
Technical Details
Message-ID: <FQ2Fa.64526$pR3.1383512@news1.tin.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeeder.edisontel.com!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail
References: <bc0b5u$d14$1@lacerta.tiscalinet.it>

Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII
X-Google-Thread: f94ee,6a2b274c1174c017
X-Google-Attributes: gidf94ee,public
X-Google-ArrivalTime: 2003-06-09 09:45:27 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeeder.edisontel.com!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail
From: "Genesio Conti" <genesio.conti@virgilio.it>
Newsgroups: free.it.visual-basic
References: <bc0b5u$d14$1@lacerta.tiscalinet.it>
Subject: Re: Risoluzione Video
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <FQ2Fa.64526$pR3.1383512@news1.tin.it>
Date: Mon, 09 Jun 2003 16:45:25 GMT
NNTP-Posting-Host: 62.211.229.202
X-Complaints-To: newsmaster@tin.it
X-Trace: news1.tin.it 1055177125 62.211.229.202 (Mon, 09 Jun 2003 18:45:25 MET DST)
NNTP-Posting-Date: Mon, 09 Jun 2003 18:45:25 MET DST
Organization: TIN