![]() |
|
Tutorial Resize the tools with your form - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: Tutorial Resize the tools with your form (/Thread-Tutorial-Resize-the-tools-with-your-form) Pages:
1
2
|
Resize the tools with your form - ManiT0X - 10-20-2015 i'll make this very quick because i don't have much time this is a simple way for some people who is having this problem : they make a simple form ![]() but whey they resize it , its like this ![]() here is a simple code to make it like this ![]() Code: Dim ProportionsArray() As CtrlProportions
Private Sub Form1_HandleCreated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.HandleCreated
Informload()
End Sub
Private Structure CtrlProportions
Dim HeightProportions As Single
Dim WidthProportions As Single
Dim TopProportions As Single
Dim LeftProportions As Single
End Structure
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Resizeform()
End Sub
Sub Informload()
On Error Resume Next
Application.DoEvents()
ReDim ProportionsArray(0 To Controls.Count - 1)
For I As Integer = 0 To Controls.Count - 1
With ProportionsArray(I)
.HeightProportions = Controls(I).Height / Height
.WidthProportions = Controls(I).Width / Width
.TopProportions = Controls(I).Top / Height
.LeftProportions = Controls(I).Left / Width
End With
Next
End Sub
Public Sub Resizeform()
On Error Resume Next
For I As Integer = 0 To Controls.Count - 1
Controls(I).Left = ProportionsArray(I).LeftProportions * Me.Width
Controls(I).Top = ProportionsArray(I).TopProportions * Me.Height
Controls(I).Width = ProportionsArray(I).WidthProportions * Me.Width
Controls(I).Height = ProportionsArray(I).HeightProportions * Me.Height
Next
End SubRE: Resize the tools with your form - XFL - 10-20-2015 Images appear to be broken, try and fix them when you have time to. I know trying to resize a form in any .NET language via a button or something else isn't the easiest. Thanks for the code, I guess. RE: Resize the tools with your form - ManiT0X - 10-20-2015 (10-20-2015, 03:42 PM)XFL Wrote: Images appear to be broken, try and fix them when you have time to. images seems to be working from here
RE: Resize the tools with your form - Eclipse - 10-20-2015 (10-20-2015, 03:49 PM)ManiT0X Wrote: images seems to be working from here Nope, they're broken for me too. RE: Resize the tools with your form - XFL - 10-20-2015 Theyre broken on desktop but not my mobile device.. Weird. RE: Resize the tools with your form - ManiT0X - 10-20-2015 (10-20-2015, 04:52 PM)XFL Wrote: Theyre broken on desktop but not my mobile device.. Weird. i change them from postimage to tinypic , its working with both of them on my laptop , desktop , android RE: Resize the tools with your form - XFL - 10-20-2015 (10-20-2015, 05:12 PM)ManiT0X Wrote: i change them from postimage to tinypic , its working with both of them on my laptop , desktop , android Working now, thanks. Sorry for the confusion. RE: Resize the tools with your form - dotcppfile - 10-20-2015 How is this any better than Dock or Anchor? RE: Resize the tools with your form - XFL - 10-20-2015 (10-20-2015, 05:19 PM)dotcppfile Wrote: How is this any better than Dock or Anchor? Dock sometimes makes things too obscene and can cause overlapping with static objects. However, I guess anchor in junction with dock could honestly fix that issue. RE: Resize the tools with your form - BreShiE - 10-21-2015 I just disable resizing on all my forms anyway. This shit makes it look ugly. |