Click here to Skip to main content
16,005,149 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How do you calc the absolute location of a control? Pin
rwestgraham30-Sep-05 15:34
rwestgraham30-Sep-05 15:34 
AnswerRe: How do you calc the absolute location of a control? Pin
watagal1-Oct-05 3:33
watagal1-Oct-05 3:33 
QuestionRe: How do you calc the absolute location of a control? Pin
watagal1-Oct-05 3:54
watagal1-Oct-05 3:54 
AnswerRe: How do you calc the absolute location of a control? Pin
[Marc]1-Oct-05 5:45
[Marc]1-Oct-05 5:45 
QuestionInfinite loop - Resizing Form Pin
watagal30-Sep-05 7:06
watagal30-Sep-05 7:06 
AnswerRe: Infinite loop - Resizing Form Pin
Richard_Wolf30-Sep-05 7:52
Richard_Wolf30-Sep-05 7:52 
AnswerRe: Infinite loop - Resizing Form Pin
Member 219430730-Sep-05 7:55
Member 219430730-Sep-05 7:55 
AnswerRe: Infinite loop - Resizing Form Pin
Dave Kreskowiak30-Sep-05 7:56
mveDave Kreskowiak30-Sep-05 7:56 
OK. I have to giggle a little bit here.

Follow your code. This is the CheckedChanged event right?

Well, if the user clicks on a empty checkbox, the value of Checked changes to True, right? This fires the CheckedChanged event, not because the box was checked, but because the value of Checked was altered. Now, in your code, you check the value of Checked, then change it to the opposite of what it is set to. This fires the CheckedChanged event again because, well, you changed it! Guess what happens next...

Why are you changing the value of Checked at all? Don't! As far as I can tell, you don't need to do it for any reason. All your doing is changing the size of the form based on whether the checkbox is checked or not. Why is your code changing the checkbox value?

Eliminate the lines that are changing the checkbox:
Public Class LogFotosForm
    Private Sub PreviewFotoChkBx_CheckedChanged( _
        ByVal sender As System.Object, ByVal e As System.EventArgs) _
        Handles PreviewFotoChkBx.CheckedChanged
        If PreviewFotoChkBx.Checked Then
            Me.Width = 320
        Else
            Me.Width = 450
        End If
    End Sub
End Class



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

AnswerRe: Infinite loop - Resizing Form Pin
watagal30-Sep-05 8:09
watagal30-Sep-05 8:09 
QuestionSet Properties in App.config Pin
Mike0930-Sep-05 6:50
Mike0930-Sep-05 6:50 
AnswerRe: Set Properties in App.config Pin
rwestgraham30-Sep-05 9:36
rwestgraham30-Sep-05 9:36 
QuestionDebug Skill?? Pin
hung_ngole30-Sep-05 3:53
hung_ngole30-Sep-05 3:53 
AnswerRe: Debug Skill?? Pin
Dave Kreskowiak30-Sep-05 7:37
mveDave Kreskowiak30-Sep-05 7:37 
GeneralRe: Debug Skill?? Pin
hung_ngole30-Sep-05 15:03
hung_ngole30-Sep-05 15:03 
GeneralRe: Debug Skill?? Pin
Dave Kreskowiak1-Oct-05 3:14
mveDave Kreskowiak1-Oct-05 3:14 
QuestionData Control Pin
SoonerFan30-Sep-05 3:15
SoonerFan30-Sep-05 3:15 
AnswerRe: Data Control Pin
Briga30-Sep-05 3:32
Briga30-Sep-05 3:32 
AnswerRe: Data Control Pin
PatriceB30-Sep-05 3:35
PatriceB30-Sep-05 3:35 
AnswerRe: Data Control Pin
SoonerFan30-Sep-05 4:52
SoonerFan30-Sep-05 4:52 
AnswerRe: Data Control Pin
SoonerFan30-Sep-05 5:09
SoonerFan30-Sep-05 5:09 
Questionproblem regular expression Pin
absprogrammer30-Sep-05 1:37
absprogrammer30-Sep-05 1:37 
QuestionMS Agent Pin
Member 231895730-Sep-05 1:00
Member 231895730-Sep-05 1:00 
AnswerRe: MS Agent Pin
MohammadAmiry1-Oct-05 4:39
MohammadAmiry1-Oct-05 4:39 
Questionproject of vb.net Pin
Anonymous30-Sep-05 0:18
Anonymous30-Sep-05 0:18 
AnswerRe: project of vb.net Pin
Briga30-Sep-05 3:33
Briga30-Sep-05 3:33 

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.