Solved

SET ENABLED BUTTON PROPERTY TRIGGER RADION BUTTON EVENT

Posted on 2013-06-11
14
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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