Solved

SET ENABLED BUTTON PROPERTY TRIGGER RADION BUTTON EVENT

Posted on 2013-06-11
14
245 Views
Last Modified: 2013-06-17
Hi All,

I have weird problem.

  Private Sub btnProses_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _
                btnProses.Click

        Dim btn As Button = DirectCast(sender, Button)
       
           blnProcess = True

        btn.Enabled = False

       ----coding
End Sub

After  btn.Enabled = False this, application goes to :

  Private Sub RadioButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _
                rdbDariTemplate.Click, _
                rdbDariPerusahaan.Click

        If blnProcess Then Exit Sub

End Sub

That's why I put blnProcess

Why's going on ?

Thank you.
0
Comment
Question by:emi_sastra
  • 7
  • 7
14 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39240323
No idea what the question is. You want to raise radio button select event when button is clicked?

By the way, you can replace this

        Dim btn As Button = DirectCast(sender, Button)
       
           blnProcess = True

        btn.Enabled = False

with

        blnProcess = True
        btnProses.Enabled = False

as you are only handling one button click in that procedure (as this code shows).
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 39240341
I mean.

When I press btnProses, it goes to :

  Private Sub btnProses_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _
                btnProses.Click

        Dim btn As Button = DirectCast(sender, Button)
       
           blnProcess = True

        btn.Enabled = False -->> The problem is it goes to RadioButton_Click automatically.

       ----coding
End Sub


Thank you.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39242493
Can you show your complete code? I don't see why it would do that based on existing code.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 39250789
Please see the video.

You won't believe it.

Thank you.
ENABLED-PROBLEM.swf
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39251219
Ok. As a test, can you change this

        Dim btn As Button = DirectCast(sender, Button)
       
           blnProcess = True

        btn.Enabled = False

to
       
           blnProcess = True

           btnProses.Enabled = False
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 39251256
Same effect.

Thank you.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39251260
In that case we will need to see more code.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:emi_sastra
ID: 39251265
What that be ?

Thank you.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39251305
Possible all the code from that form.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 39251324
What could be the problem ?
Even I put those radio button inside panel, the problem still there.

Thank you.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39251707
Problem could be anything and hard for me to guess without having access to all the code. One way of finding it out would be to look at the call stack window when radio button change event fires and see where it is coming from.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 39251952
- One way of finding it out would be to look at the call stack window when radio button change event fires and see where it is coming from.
How to check it, what should I do ?

Thank you.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39253584
0
 
LVL 1

Author Closing Comment

by:emi_sastra
ID: 39255051
Great.

Thank you very much for your help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now