|
-
Mar 2nd, 2010, 01:52 PM
#1
Thread Starter
Junior Member
Hiding Active Buttons
I need a button on mt application that nobody can see. It has to be hidden because there's a picture in the background that people need to see. If I hide the button it will also lower the chances of someone pressing it. Ultimately I need the button to have an alpha of 0 or hidden but it still needs to be active so if someone clicks it it does something. How do I do this please?
-
Mar 2nd, 2010, 02:01 PM
#2
Hyperactive Member
Re: Hiding Active Buttons
You can use the click event of the image instead of the button, that way you don't need the button at all.
To deny our own impulses is to deny the very thing that makes us human
-
Mar 2nd, 2010, 02:12 PM
#3
Re: Hiding Active Buttons
Are you developing in Windows Forms or WPF?
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Mar 2nd, 2010, 02:20 PM
#4
Thread Starter
Junior Member
Re: Hiding Active Buttons
It's a touch screen I'm working with, so, if someone knocks it accidently they would be clicking on the picture and a password form appears. I'd rather this not happen. So I was going to place an invisable button in the top left hand corner. If you know where the button is you'll click it easily but there's less chance of someone who doesn't know about it accidently clicking it. I'm developing in windows forms.
PS I said a picture, it's a webpage that I'm showing (sorry) don't know if it makes any differences
-
Mar 2nd, 2010, 03:16 PM
#5
Re: Hiding Active Buttons
 Originally Posted by Michael_
It's a touch screen I'm working with, so, if someone knocks it accidently they would be clicking on the picture and a password form appears. I'd rather this not happen. So I was going to place an invisable button in the top left hand corner. If you know where the button is you'll click it easily but there's less chance of someone who doesn't know about it accidently clicking it. I'm developing in windows forms.
PS I said a picture, it's a webpage that I'm showing (sorry) don't know if it makes any differences
How are you showing the webpage on your windows form?
Did this touch screen come with an SDK for the touch screen and an emulator?
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Mar 2nd, 2010, 04:39 PM
#6
Thread Starter
Junior Member
Re: Hiding Active Buttons
I'm not making the program on the touch screen. I'm making it on a standard, if a bit old, laptop. The touch screen won't have a mouse or keyboard attached (you can attach one but the monitor is screwed into the wall and you'd have to take it off first). So I've made the program so it will run on start-up, go into fullscreen mode, and hide the cursor. It sound like I'm trying to do something sinister, but really, it's going to be in a public place where anyone could lay their greasey mitins on it! So it needs to be fully locked with a hidden button in the top left hand corner that, when pressed (or even double pressed) will open a password form. If the user enters the password correctly the program shuts down and returns to windows (This is for any technician that might need to access it for some reason - also looks more professional that unscrewing it from the wall and turning it off using the button or attaching a keyboard and pressing alt + f4)
I can do all this fine it's just the invisible button
I'm displaying the webpage by using the built in webBrowser that's in the tools panel. The touch screen has an embedded Windows XP. I know I can run my application on it. What it will do is display a webpage from another computer on the network and my program will show that webpage on the touch screen computer. All that works. But what I really need is a way to have an invisible button that someone can click and it opens another form. I can open another form and do all the rest of it with a standard button (that's on display sadly) but I don't want it to be transparent. It would look alot better this way. Would it work if I placed a transparent image as the background image for the button, or is there a better way round it?
- By the way when you talk about an SDK are you on about the German Traffic Information System or the Software Development Kit - lol
Thanks
-
Mar 3rd, 2010, 08:51 AM
#7
Re: Hiding Active Buttons
The standard rule since VB6 is that if you have an invisible button, you cannot trigger the click event of the button by clicking on it. You can call the click_event by some other action.
I had worked on a project involving touch screens in 2001 and the touch screen had its SDK, which plugged into VC++. The SDK offered a few events that were not available in the standard VC++ form. So I was wondering if you have a similar SDK.
I gave some more thought to your problem. If you have a panel in your form and write code on the mouse_down event of that panel, will it work for you?
For instance I have this line of code in the panel control's mousedown event.
When I run my form, the panel control is invisible, but if I go to the area where the panel is, and click the mouse button, it fires up the messagebox.
Will something like this work for you?
vb.net Code:
Public Class Form1 Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown MsgBox("Hello! You have entered my panel") End Sub Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint End Sub End Class
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Mar 3rd, 2010, 12:15 PM
#8
Thread Starter
Junior Member
Re: Hiding Active Buttons
Sorry I couldn't get it to work, the panel wasn't transparent.
At the minute I have a black border round the outside using 4 different panels but I thought I could have one big invisible panel that covers the whole screen. When the user clicks it I test for the mouse location. If the mouse.x < 50 and mouse.y < 50 (the top left hand corner) as an example. then the password box opens. But like the buttons I can't make the panel invisible and active? Is there a sub to test whether the user clicks on the webbrowser. I tried copying one that worked for the buttons but it said that it wouldn't work for the webbrowser
Last edited by Michael_; Mar 3rd, 2010 at 12:41 PM.
-
Mar 3rd, 2010, 01:29 PM
#9
Re: Hiding Active Buttons
 Originally Posted by Michael_
Sorry I couldn't get it to work, the panel wasn't transparent.
At the minute I have a black border round the outside using 4 different panels but I thought I could have one big invisible panel that covers the whole screen. When the user clicks it I test for the mouse location. If the mouse.x < 50 and mouse.y < 50 (the top left hand corner) as an example. then the password box opens. But like the buttons I can't make the panel invisible and active? Is there a sub to test whether the user clicks on the webbrowser. I tried copying one that worked for the buttons but it said that it wouldn't work for the webbrowser
Where are you trying to put the panel? I put it on a form. I can zip my project up and send it across.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|