Click here to Skip to main content
15,913,854 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: State of form Pin
Christian Graus25-Nov-07 23:49
protectorChristian Graus25-Nov-07 23:49 
GeneralRe: State of form Pin
nishkarsh_k26-Nov-07 3:31
nishkarsh_k26-Nov-07 3:31 
GeneralRe: State of form Pin
Luc Pattyn26-Nov-07 4:33
sitebuilderLuc Pattyn26-Nov-07 4:33 
Questionu know abt smart card programming... Pin
cc_don25-Nov-07 21:15
cc_don25-Nov-07 21:15 
AnswerRe: u know abt smart card programming... Pin
leckey26-Nov-07 4:36
leckey26-Nov-07 4:36 
GeneralRe: u know abt smart card programming... Pin
Pete O'Hanlon26-Nov-07 10:59
mvePete O'Hanlon26-Nov-07 10:59 
QuestionDisable Ctrl+Shift+Tab Key in Tab Cotrols in .net Pin
Dot Net Jantu25-Nov-07 20:04
Dot Net Jantu25-Nov-07 20:04 
AnswerRe: Disable Ctrl+Shift+Tab Key in Tab Cotrols in .net Pin
nlarson1126-Nov-07 16:18
nlarson1126-Nov-07 16:18 
AnswerRe: Database Pin
Christian Graus25-Nov-07 19:33
protectorChristian Graus25-Nov-07 19:33 
GeneralRe: Database Pin
Dave Kreskowiak26-Nov-07 16:58
mveDave Kreskowiak26-Nov-07 16:58 
QuestionHow Can I Join VB Applications? Pin
Dreamer200725-Nov-07 19:19
Dreamer200725-Nov-07 19:19 
AnswerRe: How Can I Join VB Applications? Pin
Christian Graus25-Nov-07 19:37
protectorChristian Graus25-Nov-07 19:37 
AnswerRe: How Can I Join VB Applications? Pin
Paul Conrad26-Nov-07 16:12
professionalPaul Conrad26-Nov-07 16:12 
Questionreflection issue Pin
Tauseef A25-Nov-07 18:39
Tauseef A25-Nov-07 18:39 
AnswerRe: reflection issue Pin
Dave Kreskowiak26-Nov-07 2:44
mveDave Kreskowiak26-Nov-07 2:44 
GeneralRe: reflection issue Pin
nlarson1126-Nov-07 16:15
nlarson1126-Nov-07 16:15 
GeneralRe: reflection issue Pin
Dave Kreskowiak27-Nov-07 4:49
mveDave Kreskowiak27-Nov-07 4:49 
GeneralRe: reflection issue Pin
nlarson1127-Nov-07 5:00
nlarson1127-Nov-07 5:00 
GeneralRe: reflection issue Pin
Dave Kreskowiak27-Nov-07 5:24
mveDave Kreskowiak27-Nov-07 5:24 
nlarson11 wrote:
each control has an event "enabledchanged" is there a way to make this fire even if you give it the same value? Enabled=true / Enabled=true?


No, it'll fire whenever the value actually changes.


nlarson11 wrote:
Is there any other technique that can be done that doesn't envolve creating my own control wrapper to detect this?


Nope. You have to replace the Enabled property's Set method of the controls to get this to work. As it stands now, the Enable property code is this:
<DispId(-514), Localizable(True), SRCategory("CatBehavior"), SRDescription("ControlEnabledDescr")> _
Public Property Enabled As Boolean
    Get
        If Not Me.GetState(4) Then
            Return False
        End If
        Return ((Me.ParentInternal Is Nothing) OrElse Me.ParentInternal.Enabled)
    End Get
    Set(ByVal value As Boolean)
        Dim enabled As Boolean = Me.Enabled
        Me.SetState(4, value)
        If (enabled <> value) Then
            If Not value Then
                Me.SelectNextIfFocused
            End If
            Me.OnEnabledChanged(EventArgs.Empty)
        End If
    End Set
End Property

See the bolded If statement?? That's why the event won't fire if the value doesn't actually change. If the internal enabled variable is the same as the value passed in, the OnEnabledChanged method is never called, which is what raises the event.

Actually, the more I think about this, I'd ADD A NEW EVENT, possibly called EnabledSet, and raise it from the Set code in the Enabled property. I would NOT change the behavior of the existing EnabledChanged event.



A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: reflection issue Pin
nlarson1127-Nov-07 5:37
nlarson1127-Nov-07 5:37 
QuestionHow to find Reciprocal URL Pin
swguy2325-Nov-07 17:29
swguy2325-Nov-07 17:29 
AnswerCross Posted from Web Develoment Forum (x3) -- Ignore Pin
Vasudevan Deepak Kumar25-Nov-07 17:54
Vasudevan Deepak Kumar25-Nov-07 17:54 
GeneralRe: Cross Posted from Web Develoment Forum (x3) -- Ignore Pin
Paul Conrad25-Nov-07 18:17
professionalPaul Conrad25-Nov-07 18:17 
AnswerRe: How to find Reciprocal URL Pin
Paul Conrad25-Nov-07 18:16
professionalPaul Conrad25-Nov-07 18:16 
QuestionCreate a Fill() function with parametres Pin
dcode2525-Nov-07 13:59
dcode2525-Nov-07 13:59 

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.