Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Professionals
|
Visual Basic 2008 Professionals For advanced Visual Basic coders working in version 2008. Beginning-level questions will be redirected to other forums,
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 23rd, 2009, 02:30 AM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default How to deactivate click on particular Label

Hi
Code:
Public Class Form1
Dim circle = Image.FromFile("d:\circle.bmp")

--
--
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
Label3.Image = circle
Label3.Enabled = False
--
--
In my program i have loaded an image to a Label3 on click over it.....
then i have disabled the Label....so no further clicks on Label3 should be executed....
but disabling the Label3 is making my actual image grayish.......
which i dont want, to happen....
i just want no further clicks on that Label3 should be executed but without disabling it(so that image wont become grayish)...how it can be done....


Thanks & Regards
Sweety
 
Old June 23rd, 2009, 08:41 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Try...

Try removing the event handler for the Label click instead of disabling the label.

Code:
    Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
        Label3.Image = circle
        RemoveHandler Label3.Click, AddressOf Label3_Click
    End Sub
__________________
Jason Hall

Follow me on Twitter @jhall2013
The Following User Says Thank You to alliancejhall For This Useful Post:
sweety (June 24th, 2009)
 
Old June 24th, 2009, 03:10 PM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Thumbs up

Thanks

alliancejhall


It worked very well......





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to see a label hombre Java Basics 3 March 4th, 2008 06:15 AM
Need Help with Dynamic Link Label Click Events chobo2 C# 4 November 8th, 2007 03:47 AM
Activate or Deactivate controls on forms chacquard Access VBA 3 November 27th, 2006 08:03 AM
Right-Click or Double-Click Combobox? panuvin C# 2005 3 June 15th, 2006 04:30 PM
TomCat 5.0.19 CaseSensitive deactivate mulle78 Apache Tomcat 0 May 11th, 2004 07:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.