473,657 Members | 2,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide and unhide

3 New Member
Hello all i am rather new to the whole c # and .net language. my question is in regards to the c# portion of the matter. this is my code block which i have for hiding and unhiding::

Expand|Select|Wrap|Line Numbers
  1.         private void Form1_KeyDown(object sender, KeyEventArgs e)
  2.         {
  3.             if (e.Alt && e.KeyCode.ToString() == "F")
  4.             {
  5.                 // When the user presses both the 'Alt' key and 'F' key,
  6.                 // KeyPreview is set to False, and a message appears.
  7.                 // This message is only displayed when KeyPreview is set to True.
  8.                 this.Visible = false;
  9.                 MessageBox.Show("KeyPreview is True, and this is from the FORM.");
  10.             }
  11.         }
  12.         private void textBox1_KeyDown(object sender, KeyEventArgs e)
  13.         {
  14.             if (e.Alt && e.KeyCode.ToString() == "F")
  15.             {
  16.                 // When the user presses both the 'Alt' key and 'F' key,
  17.                 // KeyPreview is set to False, and a message appears.
  18.                 // This message is only displayed when KeyPreview is set to False.
  19.                 this.KeyPreview = true;
  20.                 MessageBox.Show("KeyPreview is False, and this is from the CONTROL.");
  21.             }
  22.         }

now what my main question is how do i call to a form after it hidden per a keyboard shortcut... i do not want a system tray icon to show or anything this a key combination to bring it back. what it appears is that i may have to use another method due to the fact that i can't input to the form directly if it is hidden. any help is greatly appreciated.

Trae Wathen
Jun 4 '07 #1
1 1483
Plater
7,872 Recognized Expert Expert
You need to create what I believe is refered to as a "global hook", your program will monitor keyboard events even when it does not have the focus.
I cannot remember how to do this (it might require a dllimport) but google "global hook in c#" or something.
They are not natively supported in .NET
See: http://support.microsoft.com/kb/318804
And : http://msdn2.microsoft.com/en-us/library/ms644959.aspx
Jun 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
6292
by: deko | last post by:
Is there any way to work around the blank space created by hidden divs? I'm trying to use a relatively postioned divs with show/hide behaviors to annotate an image. The divs show/hide onMouseOver/onMouseOut but leave a blank space on the page when hidden (the space where the divs would normally be). Is it possible to use z-indexing to put regular content where the hidden divs would be? When I try to do this, the layers don't unhide as...
9
33433
by: Wang, Jay | last post by:
I try to group several rows in a table into a div and show/hide them by click on a button somewhere with a javascript link. When clicked, the link will toggle the style of the div section's style between BLOCK and NONE. This technique works on normal text fine, but it doesn't work on part of the table, is there a solution that I can achieve the goal of turning on/off several rows all together? Thanks.
5
4770
by: mooeypoo | last post by:
Hello all, I'm a php developer. I have been using a very simple script to hide/unhide divs in my script: function DisplayI(obj) { obj.style.display=("none"==obj.style.display? "block" : "none"); }
2
18367
by: Peter K | last post by:
How do I Hide/Unhide the Main Database Window in VB?
1
20216
by: Simon | last post by:
Dear reader, In a form with the property "Default view" as DataSheet I like to hide some fields in the datasheet view. It is possible to manage this with the command Format>>Unhide columns, a form pops up with tick boxes to hide or unhide the columns.
3
2790
by: toodi4 | last post by:
I'm using a javascript that hides and unhides text based on a button click. It works great across static fields on a form. The problem I have is that I'm trying to hide and unhide various fields that are populated on the page by a database. In other words, sometimes there are 4 fields, sometimes 6. I've used various scripts for the hide/unhide function. This is one I'm using now that I've copied from another source: <script...
3
2432
by: =?Utf-8?B?aWxy?= | last post by:
Hi All I am developing an vb 2005 winforms application that connects to a database and displays a datagridview of the data. A user can select and then edit, or create a new entry by opening a modal form and editing the record. I would like the user to be able to hide either the parent form or the parent and modal form if they are currently editing in the modal form and unhide the parent or both forms from the notification icon. I seem...
1
5779
by: Simon | last post by:
Dear reader, In a datasheet form you have the possibility to hide or unhide columns. But in case the datasheet form is a sub-form this functionality is not longer available.
4
3065
by: somasekhar | last post by:
Does anyone know how to have a user click a checkbox to unhide a editfield Unclick of the checkbox would hide it again. There is an example of html file on the Javascript .But I want hide and unhide same as in xml file plz give me the answer with example any body knows. <html> <head> <title>CB Hide/Show</title> <script type="text/javascript"> <!-- function showMe (it, box) { var vis = (box.checked) ? "block" : "none";...
6
3954
by: Ralph | last post by:
Hi, I was reading effictive C++ and some other books again and they all tell you about hiding implementation details (proxy/pimpl/inheritance) but they never really explain when to use it. I am starting on a new project which is part library so I think it would be good to hide the implementation for the public classes in the library but this seems a lot of overhead to me (both when developing and runtime overhead).
0
8397
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
8732
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...
0
7333
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...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.