picturebox and gotfocus/lostfocus

Posted on 2007-07-30
Last Modified: 2013-11-26
I made 2 components in 2005. One textbox and a checkbox. The checkbox exist of a label and a picturebox. When i click on the picturebox i make a When i put a textbox and a checkbox on the form i want to color it when it has the focus. Problem is that the picturebox has no gotfocus or lostfocus at all.
How can i simulate that. So not with the mouse but just with the tab
Question by:dgb
    LVL 48

    Expert Comment

    Can you explain yourself better ? PictureBox as GotFocus and LostFocus events!

    Author Comment

    Yes they have, but are not working. Draw a picturebox on a form and put in the gotfocus a messagebox.
    Problem is maybe that there is no tabstop. But even when you click on it there is no event gotfocus fired!
    LVL 48

    Accepted Solution

    Good point. I never test it before and it doesn't work! I never done it before and I dont know if its possible. :-)

    Can you replace the picturebox control with a command button ? You can change the flatstyle to flat, FlatAppearance-BorderSize to 0, remove the text and add the image that you want.

    Its the best way I found it !

    Author Comment

    hi jpaulino,
    However it's not the exact solution to my problem, i adapt your idea for using the command button. This works ok.
    LVL 48

    Expert Comment

    Sometimes whe have to ajust it according with the available solutions.

    Good luck.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    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…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    761 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

    9 Experts available now in Live!

    Get 1:1 Help Now