?
Solved

Need to disable the the click on checkbox

Posted on 2006-05-05
3
Medium Priority
?
285 Views
Last Modified: 2010-04-23
Hi i have checkbox that needs to be validated for permissions each time the user checks or unchecks the box.   Depending on the permissions function Ispassword I want to disable the click. so if ispassword returns false than the click event will not get fired and no change occurs to the state of the checkbox. The code below Does not seem to be working. Am I using the correct event or is there something else wrong with the code below?


Private Sub chkLatePaymentFee_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkLatePaymentFee.Click


        Dim bOK As Boolean = False
        Dim bChkLatePaymentfee As Boolean

        If bChkLatePaymentfee = IsPasswordValid(goData.DBUser, String.Empty, WINTAG_LATEPAYMENT) Then
            bOK = True
        Else
            MessageBox.Show(goCaptions.GetMessage(204665), "PRISM", MessageBoxButtons.OK, MessageBoxIcon.Warning)
            bOK = False
            chkLatePaymentFee.Checked = chkLatePaymentFee.Checked

        End If
0
Comment
Question by:anwarmir
3 Comments
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 400 total points
ID: 16616901
Hi anwarmir,

Set the Enabled or the AutoCheck property to false

Cheers!
0
 
LVL 3

Accepted Solution

by:
maidinhtai earned 600 total points
ID: 16617107
Try this (with AutoCheck property is set to True):
Private Sub chkLatePaymentFee_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
chkLatePaymentFee.Click


        Dim bOK As Boolean = False
        Dim bChkLatePaymentfee As Boolean

        If bChkLatePaymentfee = IsPasswordValid(goData.DBUser, String.Empty, WINTAG_LATEPAYMENT) Then
            bOK = True
        Else
            MessageBox.Show(goCaptions.GetMessage(204665), "PRISM", MessageBoxButtons.OK, MessageBoxIcon.Warning)
            bOK = False
            chkLatePaymentFee.Checked = Not chkLatePaymentFee.Checked

        End If
0
 

Author Comment

by:anwarmir
ID: 16617171
Thanks works like a treat
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month15 days, 19 hours left to enroll

850 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