Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 916
  • Last Modified:

picturebox and gotfocus/lostfocus

Hi,
I made 2 components in VB.net 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
thnx
0
dgb
Asked:
dgb
  • 3
  • 2
1 Solution
 
jpaulinoCommented:
Can you explain yourself better ? PictureBox as GotFocus and LostFocus events!
0
 
dgbAuthor Commented:
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!
regards
0
 
jpaulinoCommented:
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 !
0
 
dgbAuthor Commented:
hi jpaulino,
However it's not the exact solution to my problem, i adapt your idea for using the command button. This works ok.
Thnx
0
 
jpaulinoCommented:
Sometimes whe have to ajust it according with the available solutions.

Good luck.
Jorge
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now