Results 1 to 16 of 16

Thread: Bored....

  1. #1

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125

    Bored....

    I am really bored today, and just for no reason, I wrote this code. It has no real purpose, but it would look cool for a splash screen or something.
    VB Code:
    1. 'the "magical" sub... lol
    2. Public Sub GrowShrink(MaxWidth As Long, MaxHeight As Long, MinWidth As Long, MinHeight As Long, GrowSpeed As Integer, ShrinkSpeed As Integer, frm As Form)
    3. Do
    4.     If frm.Width < MaxWidth Then
    5.         frm.Width = frm.Width + GrowSpeed
    6.     End If
    7.     If frm.Height < MaxHeight Then
    8.         frm.Height = frm.Height + GrowSpeed
    9.     End If
    10.     frm.Move (Screen.Width - frm.Width) / 2, (Screen.Height - frm.Height) / 2
    11.     DoEvents
    12.     If frm.Height >= MaxHeight And frm.Width >= MaxWidth Then Exit Do
    13. Loop
    14. Do
    15.     If frm.Width > MinWidth Then
    16.         frm.Width = frm.Width - ShrinkSpeed
    17.     End If
    18.     If frm.Height > MinHeight Then
    19.         frm.Height = frm.Height - ShrinkSpeed
    20.     End If
    21.     frm.Move (Screen.Width - frm.Width) / 2, (Screen.Height - frm.Height) / 2
    22.     DoEvents
    23.     If frm.Height <= MinHeight And frm.Height <= MinWidth Then Exit Do
    24. Loop
    25. End Sub
    26.  
    27. 'and to use it:
    28. Private Sub Form_Load()
    29. Me.Visible = True
    30. GrowShrink 10000, 10000, 3000, 3000, 25, 50, Me
    31. End Sub
    <removed by admin>

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Maybe you could incorporate my fade form code (see sig)
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  3. #3

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Originally posted by Lord_Rat
    Maybe you could incorporate my fade form code (see sig)
    Holy shiat! That's a nice piece of code. I am assuming that doesn't work on Windows 9x though, or does it? If you feel you can add your fade code to what I have, then go right ahead.
    <removed by admin>

  4. #4

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Oops! I just noticed that it says directly in your sig that it only works on Win2K/XP. *smacks himself for being so stupid*
    <removed by admin>

  5. #5
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    It detects if it doesn't work and then makes the form act like if the code wasn't there at all.

    It only works on 2k and XP.

    I might add more functionality, but today I am working on my code colorizing program. . .
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  6. #6
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Originally posted by MidgetsBro
    Oops! I just noticed that it says directly in your sig that it only works on Win2K/XP. *smacks himself for being so stupid*
    But it doesn't kill programs on other OS's. That's OK I do dumb stuff also.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  7. #7
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    hey that stuff is really cool... I might add a link to your sig in my sig
    Sanity is a full time job

    Puh das war harter Stoff!

  8. #8
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Lol. Go ahead.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  9. #9
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    And here is the link to Midgets proggies also:

    http://haztek.d2g.com/getpage.php?page=programs
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  10. #10
    Hyperactive Member Jason Badon's Avatar
    Join Date
    Feb 2001
    Location
    Colorado
    Posts
    329
    Originally posted by Lord_Rat
    Maybe you could incorporate my fade form code (see sig)
    Lord_Rat I made a few mods to your code. Have a look and let me know what your thoughts are. If you like pop it in you signature for download. Thanks for the code I plan to use it in a current Project.

    Jason
    Attached Files Attached Files

  11. #11
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    Check this thread out for some more cool effects

    http://www.vbforums.com/showthread.p...ight=fade+form
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  12. #12
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    And here


  13. #13
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    Damn it!! I was going to do that!

    Ah well, great minds think alike i guess
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  14. #14
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Originally posted by Jason Badon


    Lord_Rat I made a few mods to your code. Have a look and let me know what your thoughts are. If you like pop it in you signature for download. Thanks for the code I plan to use it in a current Project.

    Jason
    I'm glad people like it!

    As for the code change you made. It may be the 'right' way to do it (the fade), but I'm not sure that all future versions will handle the code the same way or that they won't come out with Windows FH or somethin. I made it detect whether the fade worked right or not and act accordingly. Again, yours is probably more correct and I'm divided as to which method is more appropriate.

    Could we have some more opinons, please!!
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  15. #15
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Looking at your code more, I see that you made it operate without a timer.

    The problem with this is that the user is unable to interact with the form until it is fully faded in or out.

    On a fast system, this is not really a problem, but on slower systems, the form might take a little longer to fade in and to require the user to wait while processing does not seem to be the way to go.

    Once again, I am thankful for your modifications and your insight, however, I do not feel that I wish to implement the code in the manner in which you did.

    In remaining fair, however, I will offer BOTH files from now on in my sig and the second fade form will keep your name in it.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  16. #16
    Hyperactive Member Jason Badon's Avatar
    Join Date
    Feb 2001
    Location
    Colorado
    Posts
    329
    Thanks for your feed back.

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