Solved

SET ENABLED BUTTON PROPERTY TRIGGER RADION BUTTON EVENT

Posted on 2013-06-11
14
247 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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