473,668 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invisible panel control events...

How do I make a panel control invisible, but still recieve events?

I have a panel that I set visible= false, and over it I am using GDI+
to paint a grid of rectangles. It has to be invisble or else it covers
up the GDI+. However, it is not firing the mousedown and up events
while it is not visible. I am setting the visible property using VS
through the properties window.

I kind of anticipated that an invisble control would still recieve the
click events, but I guessed wrong. I'm not sure how to proceed on
this. Maybe if there is a way to set the control to 100% transparent?

Apr 17 '06 #1
6 3161
<sh******@cs.fs u.edu> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
How do I make a panel control invisible, but still recieve events?

I have a panel that I set visible= false, and over it I am using GDI+
to paint a grid of rectangles. It has to be invisble or else it covers
up the GDI+. However, it is not firing the mousedown and up events
while it is not visible. I am setting the visible property using VS
through the properties window.

I kind of anticipated that an invisble control would still recieve the
click events, but I guessed wrong. I'm not sure how to proceed on
this. Maybe if there is a way to set the control to 100% transparent?


You can't. Just make the panel visible and make it the same size as what you
are painting and then paint onto the panel only. If you need mouse movements
for a subsection of your painting then do that in code.

Michael
Apr 18 '06 #2
"paint onto the panel only"

I don't guess I understand that part...
When I paint my rectangles with GDI+ they don't show up if the panel is
visible. It's like the panel is getting painted after my GDI+ does
when the onpaint event is fired.

Thanks for your help.

Apr 18 '06 #3
<sh******@cs.fs u.edu> wrote in message
news:11******** *************@e 56g2000cwe.goog legroups.com...
"paint onto the panel only"

I don't guess I understand that part...
When I paint my rectangles with GDI+ they don't show up if the panel is
visible. It's like the panel is getting painted after my GDI+ does
when the onpaint event is fired.


The form will have the WS_CLIPCHILDREN style which will mean that any
painting to the form will not paint over any of the controls. It's not that
the panel paints over it, it's that painting never occurs over the panel to
start with. What you should be doing is painting to the panel, not the form.
You can use the panel's paint event instead of the forms OnPaint override,
or if you want to use the panel's OnPaint override you'll need to inherit
it.

Michael
Apr 18 '06 #4
Michael C,

What is more simple than hittesting against a pixel (point)? Just compare
the mouse coordinates with the point location . For better user experiance
you can add some interval around the point.
--

Stoitcho Goutsev (100)

"Michael C" <no****@nospam. com> wrote in message
news:eb******** ******@TK2MSFTN GP02.phx.gbl...
<sh******@cs.fs u.edu> wrote in message
news:11******** *************@e 56g2000cwe.goog legroups.com...
"paint onto the panel only"

I don't guess I understand that part...
When I paint my rectangles with GDI+ they don't show up if the panel is
visible. It's like the panel is getting painted after my GDI+ does
when the onpaint event is fired.


The form will have the WS_CLIPCHILDREN style which will mean that any
painting to the form will not paint over any of the controls. It's not
that the panel paints over it, it's that painting never occurs over the
panel to start with. What you should be doing is painting to the panel,
not the form. You can use the panel's paint event instead of the forms
OnPaint override, or if you want to use the panel's OnPaint override
you'll need to inherit it.

Michael

Apr 18 '06 #5
Thanks Michael. I didn't reallize there was an onpaint event just for
the panel.

Apr 18 '06 #6
<sh******@cs.fs u.edu> wrote in message
news:11******** **************@ z34g2000cwc.goo glegroups.com.. .
Thanks Michael. I didn't reallize there was an onpaint event just for
the panel.


OnPaint comes from Control which all controls and forms inherit from.

Michael
Apr 18 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1377
by: Alexander Brown | last post by:
Does anyone know how i can have a control which responds as if visible, capturing the relevant mouse clicks, etc, but has no visual representation. I dont mean just nothing rendered on its surface, but also no effect on its parent?
6
14688
by: Selden McCabe | last post by:
I have a form with a bunch of image buttons. When the user moves the mouse over a button, I want to do two things: 1. change the Imagebutton's picture, and 2. make another control visible. I'm using the Imagebutton.Attributes.Add("onMouseOver","this.src = 'somepicture.jpg') and that works fine. I've tried some java script to change the other control's visible property by changing is className, but that doesn't seem to work
1
3520
by: Dino M. Buljubasic | last post by:
I have two controls, a panel holding check boxes and a treeview beside the panel. I use buttons to scroll both of thes up and down at the same time but I'd like to make scroll bars on the controls invisible so I can use only the buttons for scrolling. Any help will be appreciated.
16
11547
by: Miguel Dias Moura | last post by:
Hello, i have 5 panels in an ASP.net / VB page. The panel 1 is visible the other 4 are NOT visible. I also have 5 images: image 1, image 2, ..., image5. When i click one of the images, image N, the panel N becomes visible and all the other invisible.
2
2067
by: Dave | last post by:
hi, I'm have a control which inherits from the panel control and I want to make it invisible at design time -- like the Timer control. Any suggestions?? Thanks, davermcl
2
2295
by: _DD | last post by:
I'm trying to gracefully intercept Control and Alt keys for mouse events within a Panel. I realize that keyboard is not normally relevant there, but in this case, I need to get Ctrl-LeftMouseButton, etc. This could be intercepted by the form that owns the panel, but that does not seem very elegant. Are there any alternatives? I could use another type of base control if necessary. I'm mostly painting graphics.
2
1811
by: snow | last post by:
Hi All, I am using VS 2005. I put some controls within a control panel and the control panel is in a tab control page. For some reason, the controls are invisible at design time. when I run the program, the controls are shown up. Could some one tell me what cause this problem and how to show these controls at design time? Thanks for the help !
5
6113
by: sklett | last post by:
I know that Panel (and most of it's derivitives) don't raise keyboard events. I *really* need to catch keyboard events though so I've been googling the topic and have found quite a few suggestions. The one suggestion I've found that makes the most sense isn't working for me and after this most recent failure I'm really at a loss! ;0) I'm overriding WndProc and checking the Message.Msg property for the WM_KEYUP message. If anyone has...
2
1599
by: kulabhishek | last post by:
Hi! I have a created an extended control that inherits from the Panel class. This functions like an editing pane and allows the user to drag and add controls over it. When I drag the child control toward one of the borders of the panel, the control is restricted to stay within the bounds of the parent panel but the mouse cursor moves out. I want to be able to change the cursor while i am dragging a child control (hence mouse button is down...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8378
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8577
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.