הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Question
Tuesday, October 29, 2013 1:57 PM
hi all
I want to make a form larger than the screen resolution.
For example:
Screen resolution: 1360x768
form size 1920x1080 (with scroll bars)
can possible this?
then how to?
I am using visual basic 2010
regards
All replies (12)
Friday, November 1, 2013 3:41 AM ✅Answered | 1 vote
hi all
I want to make a form larger than the screen resolution.
For example:
Screen resolution: 1360x768
form size 1920x1080 (with scroll bars)
can possible this?
then how to?
I am using visual basic 2010
regards
You never did mention why you wanted to do this. Perhaps there is an answer that can do what you want to do but not the way you want to do it or perhaps not the way you only think it should be done.
For example I added a borderless form with no scrollbars and doublebuffered set to true. And sized it to fill the screen including over the taskbar. Then I dynamically added a double buffered panel (with code that makes it a double buffered panel) at runtime.
Even though I could have set the panels size at runtime I used a timer to increase it from 50 X 50 to 65535 X 65535 just to make sure it would work since the form didn't have scroll bars. Once the panel was at 65535 X 65535 the timer stops and the panels paint event draws a filled rectangle and some strings close to the center of the panel. Then I right click on the panel and its left and top move -32600 each bringing the center of the panel into the picture and displaying the paint events strings and graphics at that location. Per the images below.
In the code the Panel1 MouseDoubleClick doesn't seem to work for some reason. I had it previously as Panel1 DoubleClick and that didn't work either. Don't know why. Anyhow if you need a larger area for your form you can do this. Or if you wanted a gaming area or something too.
Option Strict On
Public Class Form1
Public Panel1 As New DoubleBufferPanel
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.Size = New Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
Me.DoubleBuffered = True
Me.CenterToScreen()
Panel1.Name = "Panel1"
Panel1.Left = 0
Panel1.Top = 0
Panel1.Size = New Size(50, 50)
Panel1.BackColor = Color.Aqua
AddHandler Panel1.MouseClick, AddressOf Panel1_MouseClick
AddHandler Panel1.MouseDoubleClick, AddressOf Panel1_MouseDoubleClick
AddHandler Panel1.Paint, AddressOf Panel1_Paint
Me.Controls.Add(Panel1)
Timer1.Interval = 1
Timer1.Start()
End Sub
Private Sub Form1_DoubleClick(sender As Object, e As EventArgs) Handles Me.DoubleClick
Me.Close()
End Sub
Dim GrowOrShrink As Integer = 2
Private Sub Panel1_MouseClick(sender As Object, e As MouseEventArgs)
If e.Button = Windows.Forms.MouseButtons.Left Then
If GrowOrShrink = 2 Then
Panel1SizeMaxed = False
GrowOrShrink = 0
ElseIf GrowOrShrink = 0 Then
Panel1SizeMaxed = False
GrowOrShrink = 1
ElseIf GrowOrShrink = 1 Then
Panel1SizeMaxed = False
GrowOrShrink = 0
End If
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
If Panel1SizeMaxed = True Then
Panel1.Left = -32600
Panel1.Top = -32600
End If
End If
End Sub
Private Sub Panel1_MouseDoubleClick(sender As Object, e As MouseEventArgs)
Panel1SizeMaxed = False
GrowOrShrink = 2
Panel1.Size = New Size(50, 50)
Panel1.Left = 0
Panel1.Top = 0
End Sub
Dim Panel1Size As String = "X"
Dim Panel1Font As New Font("Cambria", 24.0F, FontStyle.Bold)
Dim Panel1SizeMaxed As Boolean = False
Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs)
e.Graphics.DrawString(Panel1Size, Panel1Font, Brushes.Black, 50, 100)
If Panel1SizeMaxed = True Then
e.Graphics.DrawRectangle(Pens.Red, CInt(Math.Round(Panel1.Width / 2) - 25), CInt(Math.Round(Panel1.Height / 2) - 25), 50, 50)
e.Graphics.FillRectangle(Brushes.Red, CInt(Math.Round(Panel1.Width / 2) - 25), CInt(Math.Round(Panel1.Height / 2) - 25), 50, 50)
e.Graphics.DrawString("I'm pretty much in the center of Panel1 at 32600 right from Panel1s Left", Panel1Font, Brushes.Black, CInt(Math.Round(Panel1.Width / 2) - 50), CInt(Math.Round(Panel1.Height / 2) + 100))
e.Graphics.DrawString("and at 32600 down from Panel1s Top.", Panel1Font, Brushes.Black, CInt(Math.Round(Panel1.Width / 2) - 50), CInt(Math.Round(Panel1.Height / 2) + 140))
End If
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Panel1.Invalidate()
If GrowOrShrink = 0 Then
Panel1.Width += 100
Panel1.Height += 100
ElseIf GrowOrShrink = 1 Then
Panel1.Width += 100
Panel1.Height += 100
End If
If Panel1.Width = 65535 AndAlso Panel1.Height = 65535 Then Timer1.Stop() : Panel1SizeMaxed = True : Panel1.Invalidate()
Panel1Size = "Panel1s Width is " & Panel1.Width.ToString & " and Panel1s height is " & Panel1.Height.ToString
End Sub
Public Class DoubleBufferPanel
Inherits Panel
Public Sub New()
Me.DoubleBuffered = True
Me.SetStyle(ControlStyles.DoubleBuffer Or ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint, True)
Me.UpdateStyles()
End Sub
End Class
End Class
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.
Friday, November 1, 2013 7:44 AM ✅Answered | 2 votes
My Screen resolution: 1360x768
Want form size 1920x1080 (with scroll bars) at "design time"
You can't create a form larger than the display, because Windows does not provide any means for scrolling a form. If you could create a form that size then the menu bar and control box could be scrolled off the display, and that would be extremely confusing to users.
You can make a form fill the whole display, and then create a container (such as a panel) within the form. If you choose the correct options then scrollbars will be available to scroll the contents of the container, so that those contents can be placed anywhere, including beyond the container's boundary.
See: http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollablecontrol.autoscroll.aspx
Tuesday, October 29, 2013 3:37 PM
hi all
I want to make a form larger than the screen resolution.
For example:
Screen resolution: 1360x768
form size 1920x1080 (with scroll bars)
can possible this?
then how to?
I am using visual basic 2010
regards
Not to my knowledge. Is there a reason you want to do this? You can put a Panel on a Form that has scroll bars and make the panels size up to 65535.
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.
Tuesday, October 29, 2013 4:55 PM
Hi All
Can possible Make a from larger than screen resolution (design mode also) in vb.net?
means My screen resolution: 1360x768
I want make form: 1920x1080
can possible this?. then How?
I am using visual basic 2010
regards
Tuesday, October 29, 2013 5:33 PM
Hi All
Can possible Make a from larger than screen resolution (design mode also) in vb.net?
means My screen resolution: 1360x768
I want make form: 1920x1080
can possible this?. then How?
I am using visual basic 2010
regards
Please do not double post; respond to the thread you already have open.
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
Wednesday, October 30, 2013 4:00 AM
Been trying to improve the way I dealt with WindowState and Resizable Forms, so I studied a bit and came up with the following - as a simple model. With the idea that I have to design the UI to a minumum clientsize, and then know how to deal with any clientsize larger that is thrown at it. Someone may get a few ideas from it. I welcome any feed-back and advice.
Public Class Form4
Dim F As Boolean
Private Sub Form4_Load(sender As Object, e As System.EventArgs) Handles Me.Load
' set all permanent control bounds
' here
'
ClientSize = New Size(876, 610) ' << set your minimum clientsize
MinimumSize = Size
Dim L As Integer = My.Settings.FrmSz.IndexOf(",")
Width = CInt(My.Settings.FrmSz.Substring(0, L))
Height = CInt(My.Settings.FrmSz.Substring(L + 1, My.Settings.FrmSz.Length - L - 1))
variablebounds()
CenterToScreen()
End Sub
Sub variablebounds()
' Set all variable control bounds
' here
Text = CStr(ClientSize.Width) & " : " & CStr(ClientSize.Height)
'
End Sub
Private Sub Form4_ResizeEnd(sender As Object, e As System.EventArgs) Handles Me.ResizeEnd
My.Settings.FrmSz = CStr(Width) & "," & CStr(Height)
variablebounds()
End Sub
Private Sub Form4_SizeChanged(sender As Object, e As System.EventArgs) Handles Me.SizeChanged
If F Then
F = False
variablebounds()
End If
If WindowState = FormWindowState.Maximized Then
variablebounds()
F = True
End If
End Sub
End Class
PS I forgot to say you need to add this variable to My.Settings : FrmSz : String : "892,648"
Leon C Stanley - - A dinky di VBer - - Code is like fresh baked bread - it goes stale after a while - - so why try to immortalize it ? and turn it into a Class? ^^ :-)
Friday, November 1, 2013 6:16 AM
thanks all
My Screen resolution: 1360x768
Want form size 1920x1080 (with scroll bars) at "design time"
I want to change width and height in form's properties in design mode
regards
Friday, November 1, 2013 7:36 AM
thanks all
My Screen resolution: 1360x768
Want form size 1920x1080 (with scroll bars) at "design time"
I want to change width and height in form's properties in design mode
regards
You'll have to buy a screen with a resolution of 1920X1080 to size a form to that size.
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.
Friday, November 1, 2013 12:36 PM
thanks all
My Screen resolution: 1360x768
Want form size 1920x1080 (with scroll bars) at "design time"
I want to change width and height in form's properties in design mode
regards
Hi,
You can set the Size property of the form in the designer properties to 1920, 1080. However, if you want it to resize to 1360, 768 and re-arange all the controls so that they fit in the smaller size when the app is running then that could get kind of tricky. You could attempt it using the Anchor properties of the controls but, as i said it may be a little tricky depending on the layout of the controls on your form.
Friday, November 1, 2013 3:23 PM | 2 votes
thanks all
My Screen resolution: 1360x768
Want form size 1920x1080 (with scroll bars) at "design time"
I want to change width and height in form's properties in design mode
regards
Hi,
You can set the Size property of the form in the designer properties to 1920, 1080. However, if you want it to resize to 1360, 768 and re-arange all the controls so that they fit in the smaller size when the app is running then that could get kind of tricky. You could attempt it using the Anchor properties of the controls but, as i said it may be a little tricky depending on the layout of the controls on your form.
I tried this by setting a form so its min, max and size were all 2500 x 2500 and the form would only size to 1382 x 784. Where 1382 - 16 (left and right borders are 8 each) = 1366 (my screens width bounds) and 784 - 18 = 766 (my screens height bounds) which leaves a wee bit of the header and bottom border in the screen. So it will not size larger than the screen pretty much. Unless you know how to do it with some other method perhaps.
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.
Friday, November 1, 2013 3:32 PM | 1 vote
thanks all
My Screen resolution: 1360x768
Want form size 1920x1080 (with scroll bars) at "design time"
I want to change width and height in form's properties in design mode
regards
Use the properties grid to set the Size to 1920x1080.
The form will immediately grow to that size and the form designer will show scroll bars for you to move the form around within the design area.
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
Friday, November 1, 2013 4:13 PM | 1 vote
I tried this by setting a form so its min, max and size were all 2500 x 2500 and the form would only size to 1382 x 784. Where 1382 - 16 (left and right borders are 8 each) = 1366 (my screens width bounds) and 784 - 18 = 766 (my screens height bounds) which leaves a wee bit of the header and bottom border in the screen. So it will not size larger than the screen pretty much. Unless you know how to do it with some other method perhaps.
Your write. I tried it real quick before and i seen it re-sized bigger and the scroll bars showed but, i did not notice that the size had automatically set itself back to a smaller size. I would have never noticed if you didn`t point it out. :)