Results 1 to 3 of 3

Thread: Random Form Resizes

  1. #1

    Thread Starter
    Fanatic Member Vectris's Avatar
    Join Date
    Dec 2008
    Location
    USA
    Posts
    941

    Random Form Resizes

    This happened a while ago and it's returned, and I still can't figure it out.

    For some reason, a certain Form in my project will change it's size all on it's own right after I call it. It's usually with small forms in the one I'm having a problem with is 95x25 pixels. The only thing on it is a Label with some text in the middle and this code

    Code:
    Public Class MessageForm
        Private Time As Integer = 25
    
        Private Sub fadeTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fadeTimer.Tick
            Time -= 1
            If Me.Opacity <> 0 Then
                If Time < 0 Then Me.Opacity -= 0.01
            Else
                Me.Close()
            End If
        End Sub
    End Class
    As you can see the Form is meant to be a small pop-up that disappears on its own, like a balloon tip.

    Anyways I just added it to my project 5 minutes ago and as soon as I tested it out by displaying it with Form.Show(), it randomly changed to 123 by something else during runtime.

    I checked all the Form properties for any kind of resize properties and only found AutoScaleMode which was set on font, but set on None made no difference.

    Like I said I just added this form and have no code affecting it whatsoever in my entire project except for Form.Show and the code on that form.

    For the moment I'm just resizing the form on it's own Load event, and that seems to work, but I'd like to know what is causing this random form resize, any ideas?
    If your problem is solved, click the Thread Tools button at the top and mark your topic as Resolved!

    If someone helped you out, click the button on their post and leave them a comment to let them know they did a good job

    __________________
    My Vb.Net CodeBank Submissions:
    Microsoft Calculator Clone
    Custom TextBox Restrictions
    Get the Text inbetween HTML Tags (or two words)

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Random Form Resizes

    The minimum possible size of a form is dependent on the value of the FormBorderStyle property. When the FormBorderStyle is Sizable the minimum possible size is 123 x 34.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member Vectris's Avatar
    Join Date
    Dec 2008
    Location
    USA
    Posts
    941

    Re: Random Form Resizes

    My FormBorderStyle is set to none. Is there anyways to increase the minimum size? It's funny because during runtime you can make the form anysize you want so why would it only change when the form loads.

    Also just for clarification in Design Mode I have the form set as 95x25 just the way I want it. It changes on it's own during runtime.
    If your problem is solved, click the Thread Tools button at the top and mark your topic as Resolved!

    If someone helped you out, click the button on their post and leave them a comment to let them know they did a good job

    __________________
    My Vb.Net CodeBank Submissions:
    Microsoft Calculator Clone
    Custom TextBox Restrictions
    Get the Text inbetween HTML Tags (or two words)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width