Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need a tool to automatically resize application in VB.net

Posted on 2004-10-11
18
Medium Priority
?
428 Views
Last Modified: 2010-09-08
Its a  payroll-admin program and it deals with forms, datagrids, stuff that have to display correctly. The system is already developed way too far to start re-designing in a 800x600 res.
My problem is to let the program "size down" correctly on smaller resolutions, so that the user can see the whole layout (which is imperitive). In all the program has an idiot-proof user-friendly design, but the user MUST be able to see the whole form when maximized(without scrollbars in other words)

I need a resize tool very badly...
I checked the net only sharewares are there.
I want a freeware. Can any of you provide me a link to or mail it to me? Please its urgent and i am willing to be generous with points.
0
Comment
Question by:thebeseus
  • 8
  • 5
  • 2
  • +1
18 Comments
 
LVL 18

Expert Comment

by:tusharashah
ID: 12282962
I used XnView once, it's a nice software & with bunch of functionallity:

The software is free for private and non-comercial use:

http://perso.wanadoo.fr/pierre.g/xnview/en_ncfeatures.html

-tushar
0
 

Author Comment

by:thebeseus
ID: 12283144
In case its for commercial use?
0
 
LVL 7

Expert Comment

by:LandyJ
ID: 12283342
You don't need a tool to resize.  Use the Anchor properties for each control.  Locking only certain sides, depending on such desires as resulting size, final position, etc. should do the trick.

For example, you probably don't want command buttons to grow, only move, so Anchor on two sides, say Top & Left.  That will keep the button the same size and always in the Upper Right corner of the form.  A grid control, on the other hand, you probably want it to fill up the increased space, so Anchor on Left, Right & Bottom will make it stay in the bottom of the form, and grow/shrink as the form is resized.  

By setting the WindowState to Maximized, let Windows decide how big the form is to be, and then let the Anchor properties control the resizing.

Hope this helps,
Landy
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Expert Comment

by:LandyJ
ID: 12283348
Oops, Anchor the Button on the Top & Right to keep it in the upper Right of the form.  Sorry about that.
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12283448
Also, I found this software on Download.com

http://www.download.com/Photo-Resizer/3000-2192-10326178.html?tag=lst-0-4

Seems it's free & with 78,000+ downloads! so must be good.

-tushar
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12283457
0
 
LVL 8

Expert Comment

by:gregasm
ID: 12283611
The best way to do it is to use docking. Use panels, and splitters and dock the controls centered, top, bottom, right and left. It's the most robust UI if done correctly.
0
 
LVL 7

Expert Comment

by:LandyJ
ID: 12283752
Tush, those are image resizers.  They won't help when resizing a VB form.

gregasm, good suggestion.  Using the docking and anchoring (you'll need to use both) will give you a very robust UI that will scale to any resolution your users can come up with.

0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12286221
Landy, I believe if it's possible to resize the image then it's always better, as you will be loading 100kb image rather then 1.5MB.

Your suggestions are elegant, but I am suggesting those software because Author has asked for it.

-tushar
0
 
LVL 7

Expert Comment

by:LandyJ
ID: 12288843
Tushar,

Sorry, I didn't mean to be critical, so I hope you didn't take it that way.  What I meant was, VB forms don't create an "image" so there is nothing to send to those applications to be resized.  

.NET has made resizing tools unnecessary by incorporating the Dock and Anchor settings into the forms, that's why we didn't suggest software to solve thebeseus' question.  I don't even know if there is anyone who has actually written a resizing tool for .NET.  Once a programmer gets the hang of it, it's too easy to do on one's own.

-Landy
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12289875
Oh no, you're not being cricticle.. you're explaining your views.. so do I :)

Well as per my understanding, dock & anchor setting only show smaller image they do not actually 'resize' it.

For example, if one of the images to display was a file named BigFile.gif, which was 100 KB in size and 400 pixels by 400 pixels, the image would be resized to 200 pixels by 200 pixels with dock & anchor. While this has the effect of having the image display in application as a 200x200 image, the image's file size has not changed. That is, the entire 100 KB image file is used in application.

( I might be dead wrong! In the terms of Windows Programming)

But check out following article which explain Image Resizing technique in .Net.
--> http://aspnet.4guysfromrolla.com/articles/012203-1.aspx

thebeseus : I hope we are not going off topic.

-tushar
 

0
 
LVL 7

Expert Comment

by:LandyJ
ID: 12290054
Since thebeseus hasn't replied to any of these comments, I don't know if we are off-topic or not.

You're correct with everything you are saying about resizing images and the size of the files, etc. but my take is that this is about trying to resize the form and keep his controls displayed properly.

Right now, I'd say we're both correct, until thebeseus returns to clarify.
0
 

Author Comment

by:thebeseus
ID: 12291990
Hi Landy
    Yes you are ight i dont need a photo resizer.
  Is there no resizing tool for VB applications that will let the app load correctly in any resolution?
0
 
LVL 7

Accepted Solution

by:
LandyJ earned 2000 total points
ID: 12292163
That's what the Dock and Anchor settings allow you to do.  Like I said, I've not seen a resizing tool for .NET because once you get the hang of it, this is really very easy to do.

Here's a simple example:  
Create a new project and Add a Windows form, named PlayForm.vb and cut/paste this code into the code page, overlaying any code that may already be there.  This only shows the Anchor property in action, but you'll get the idea.  You can search on SplitterBar to get good examples about using the Dock property.


Public Class playForm
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
  Friend WithEvents Button1 As System.Windows.Forms.Button
  Friend WithEvents Button2 As System.Windows.Forms.Button
  Friend WithEvents Button3 As System.Windows.Forms.Button
  Friend WithEvents Button4 As System.Windows.Forms.Button
  Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.Button1 = New System.Windows.Forms.Button()
    Me.Button2 = New System.Windows.Forms.Button()
    Me.Button3 = New System.Windows.Forms.Button()
    Me.Button4 = New System.Windows.Forms.Button()
    Me.DataGrid1 = New System.Windows.Forms.DataGrid()
    CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
    Me.SuspendLayout()
    '
    'Button1
    '
    Me.Button1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
    Me.Button1.Location = New System.Drawing.Point(664, 492)
    Me.Button1.Name = "Button1"
    Me.Button1.Size = New System.Drawing.Size(72, 28)
    Me.Button1.TabIndex = 1
    Me.Button1.Text = "Button1"
    '
    'Button2
    '
    Me.Button2.Anchor = (System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right)
    Me.Button2.Location = New System.Drawing.Point(672, 8)
    Me.Button2.Name = "Button2"
    Me.Button2.Size = New System.Drawing.Size(64, 32)
    Me.Button2.TabIndex = 2
    Me.Button2.Text = "Button2"
    '
    'Button3
    '
    Me.Button3.Location = New System.Drawing.Point(8, 8)
    Me.Button3.Name = "Button3"
    Me.Button3.Size = New System.Drawing.Size(52, 28)
    Me.Button3.TabIndex = 3
    Me.Button3.Text = "Button3"
    '
    'Button4
    '
    Me.Button4.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left)
    Me.Button4.Location = New System.Drawing.Point(12, 504)
    Me.Button4.Name = "Button4"
    Me.Button4.Size = New System.Drawing.Size(56, 20)
    Me.Button4.TabIndex = 4
    Me.Button4.Text = "Button4"
    '
    'DataGrid1
    '
    Me.DataGrid1.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                Or System.Windows.Forms.AnchorStyles.Left) _
                Or System.Windows.Forms.AnchorStyles.Right)
    Me.DataGrid1.DataMember = ""
    Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
    Me.DataGrid1.Location = New System.Drawing.Point(24, 180)
    Me.DataGrid1.Name = "DataGrid1"
    Me.DataGrid1.Size = New System.Drawing.Size(692, 276)
    Me.DataGrid1.TabIndex = 5
    '
    'playForm
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(748, 530)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.DataGrid1, Me.Button4, Me.Button3, Me.Button2, Me.Button1})
    Me.Name = "playForm"
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
    Me.Text = "playForm"
    Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
    CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
    Me.ResumeLayout(False)

  End Sub

#End Region

End Class


NOW, play with the resolution on your monitor and start your project.  I think you'll see that what you can do with the Dock and Anchor properties is what you need for your project.

Hope this helps,
Landy
0
 
LVL 7

Expert Comment

by:LandyJ
ID: 12313925
thebeseus,

Just checking to see how it was going with the Dock & Anchor settings.

-Landy
0
 
LVL 7

Expert Comment

by:LandyJ
ID: 12650638
No objection from me!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question