Click here to Skip to main content
16,004,727 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionPop sizing using timers Pin
lbs.allies1-Oct-09 20:43
lbs.allies1-Oct-09 20:43 
AnswerRe: Pop sizing using timers Pin
vedprakash2-Oct-09 1:36
vedprakash2-Oct-09 1:36 
GeneralRe: Pop sizing using timers Pin
Dave Kreskowiak2-Oct-09 7:10
mveDave Kreskowiak2-Oct-09 7:10 
GeneralRe: Pop sizing using timers Pin
lbs.allies4-Oct-09 19:16
lbs.allies4-Oct-09 19:16 
AnswerRe: Pop sizing using timers Pin
Dave Kreskowiak2-Oct-09 7:13
mveDave Kreskowiak2-Oct-09 7:13 
GeneralRe: Pop sizing using timers Pin
lbs.allies4-Oct-09 19:29
lbs.allies4-Oct-09 19:29 
GeneralRe: Pop sizing using timers Pin
lbs.allies4-Oct-09 19:46
lbs.allies4-Oct-09 19:46 
GeneralRe: Pop sizing using timers Pin
Dave Kreskowiak5-Oct-09 2:11
mveDave Kreskowiak5-Oct-09 2:11 
Both code snippets are wrong. The first one you posted would take 3000 milliseconds (3 seconds) per iteration of that loop you put in, which you don't even need!. So, doing the math, that would be about 10 MINUTES to resize the window.

This second code snippet will never reach 200 because you keep re-declaring i, reverting back to 0 every time you enter this loop. It never really tracks what the current size of the window is and add to it.

First, change the Timer interval to something like 100 milliseconds, then, in your Timer tick, add about 40 to both the width and height of the control. That will resize the window in 5 steps in 500 milliseconds (half of a second).
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    With PopupContainerControl1
        Dim newSize As New Size(.Size.Width + 40, .Size.Height + 40)
        .Size = newSize
        If newSize.Width = 200 Then
            Timer1.Stop()
        End If
    End Width
End Sub



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




Questionhow to get the complete response for a webservice created using .net Pin
prasadbuddhika1-Oct-09 17:50
prasadbuddhika1-Oct-09 17:50 
AnswerRe: how to get the complete response for a webservice created using .net Pin
Petr Pechovic4-Oct-09 12:05
professionalPetr Pechovic4-Oct-09 12:05 
Questiontext file spliting Pin
digitaldxb1-Oct-09 10:25
digitaldxb1-Oct-09 10:25 
AnswerRe: text file spliting Pin
freakyit1-Oct-09 11:49
freakyit1-Oct-09 11:49 
GeneralRe: text file spliting Pin
digitaldxb1-Oct-09 21:13
digitaldxb1-Oct-09 21:13 
AnswerRe: text file spliting Pin
PIEBALDconsult1-Oct-09 15:08
mvePIEBALDconsult1-Oct-09 15:08 
GeneralRe: text file spliting Pin
digitaldxb1-Oct-09 21:14
digitaldxb1-Oct-09 21:14 
GeneralRe: text file spliting Pin
PIEBALDconsult2-Oct-09 3:49
mvePIEBALDconsult2-Oct-09 3:49 
GeneralRe: text file spliting Pin
digitaldxb2-Oct-09 6:48
digitaldxb2-Oct-09 6:48 
GeneralRe: text file spliting Pin
shree08813-Oct-09 18:14
shree08813-Oct-09 18:14 
GeneralRe: text file spliting Pin
shree08813-Oct-09 18:14
shree08813-Oct-09 18:14 
QuestionHow to write and read HttpWebRequestStream asynchronously Pin
vsaratkar1-Oct-09 9:28
vsaratkar1-Oct-09 9:28 
QuestionHow to Edit crystal report SQL Query shown in 'Show SQL Query' Pin
she-Developer30-Sep-09 23:34
she-Developer30-Sep-09 23:34 
QuestionIndex was outside the bounds of the array while performing Stack.Pop operation Pin
Furqan Safdar30-Sep-09 1:21
Furqan Safdar30-Sep-09 1:21 
AnswerRe: Index was outside the bounds of the array while performing Stack.Pop operation Pin
Henry Minute30-Sep-09 2:23
Henry Minute30-Sep-09 2:23 
GeneralRe: Index was outside the bounds of the array while performing Stack.Pop operation Pin
burito12330-Sep-09 5:48
burito12330-Sep-09 5:48 
GeneralRe: Index was outside the bounds of the array while performing Stack.Pop operation Pin
Dave Kreskowiak30-Sep-09 7:26
mveDave Kreskowiak30-Sep-09 7:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.