ورود

View Full Version : تنظیم اندازه فرم با resolusion مونیتور ؟



alilittle
شنبه 21 آذر 1383, 19:00 عصر
چطوری میشه resolusion رو بدست آورد ؟

hbi
شنبه 21 آذر 1383, 20:14 عصر
قبلا جواب داده شده است اگر جستجو کنید مییابید البته یک برنامه دارم که ذیزولیشن را تغییر میدهد

vbprogramer
یک شنبه 22 آذر 1383, 07:46 صبح
همان طور که گفته شده اگه جستجو میکردی یکم عقب تر این جواب داده شده بود
:wise1:


Private Sub Form_Load()
Dim intWidth As Integer
Dim intHeight As Integer
intWidth = Screen.Width \ Screen.TwipsPerPixelX
intHeight = Screen.Height \ Screen.TwipsPerPixelY
MsgBox "Screen Resolution:" + vbCrLf + vbCrLf + Str$(intWidth) + " x" + Str$(intHeight), 64, "Info"
End Sub

vb4u
یک شنبه 22 آذر 1383, 07:55 صبح
سلام.

برای به دست آوردن Resolution فرم بر حسب Pixel:
<span dir=ltr>

Dim X As Single
Dim Y As Single
X = Me.Width / Screen.TwipsPerPixelX
Y = Me.Height / Screen.TwipsPerPixelY
</span>
برای به دست آوردن Resolution مانیتور بر حسب Pixel:
<span dir=ltr>
Dim X As Single
Dim Y As Single
X = Screen.Width / Screen.TwipsPerPixelX
Y = Screen.Height / Screen.TwipsPerPixelY
</span>
موفق باشید.
:wise1: