473,704 Members | 3,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a form purely programatically - by proxy.

Scenario:

Two System.Windows. Forms: Form1 and Form2.
Form1 is displayed, Form2 is hidden.

At this juncture, is it possible to take the graphics from Form2 and output
that to Form1's display and take all of the mouse and key events from Form1
and pass those on to Form2, thus changing the graphical output on Form2 and
then pasting those graphical changes back to Form1?
Is this some kind of P/Invoke job?

Regards

Jax
Feb 3 '06 #1
4 1484
Jax,

You can design this much better so that it is an easier operation.
Simply, have the contents of forms one and two contained in controls,
instead of forms, and then host both controls on the same form. Then, you
don't have to worry about all of the input switching and whatnot.

Also, one might ask, why not just hide form one and then show form two?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Tamman {Uchiha Jax}"
<i_************ *************** *******@NOSPAMh otmail.com> wrote in message
news:Ff******** ***********@new sfe5-gui.ntli.net...
Scenario:

Two System.Windows. Forms: Form1 and Form2.
Form1 is displayed, Form2 is hidden.

At this juncture, is it possible to take the graphics from Form2 and
output
that to Form1's display and take all of the mouse and key events from
Form1
and pass those on to Form2, thus changing the graphical output on Form2
and
then pasting those graphical changes back to Form1?
Is this some kind of P/Invoke job?

Regards

Jax

Feb 4 '06 #2
I don't want the user of the program to directly see the windows controls, I
want to be able to capture the graphics of the controls of the hidden form,
and overlay those graphics on Form1 (on top of another bunch of stuff i'm
drawing).
Then translate the clicks on Form1 to Form2 so that the controls are
properly updated when the graphics are next captured from Form2 and
displayed on Form1.

This is essentially a simple hack of the GUI so I can implement dynamic
graphic arrangement and not have to worry about transparency issues or
implementing WinForm control functionality.
Does this make much sense to you?

Regs

Jax
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:eA******** ******@TK2MSFTN GP09.phx.gbl...
Jax,

You can design this much better so that it is an easier operation.
Simply, have the contents of forms one and two contained in controls,
instead of forms, and then host both controls on the same form. Then, you
don't have to worry about all of the input switching and whatnot.

Also, one might ask, why not just hide form one and then show form two?
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Tamman {Uchiha Jax}"
<i_************ *************** *******@NOSPAMh otmail.com> wrote in message
news:Ff******** ***********@new sfe5-gui.ntli.net...
Scenario:

Two System.Windows. Forms: Form1 and Form2.
Form1 is displayed, Form2 is hidden.

At this juncture, is it possible to take the graphics from Form2 and
output
that to Form1's display and take all of the mouse and key events from
Form1
and pass those on to Form2, thus changing the graphical output on Form2
and
then pasting those graphical changes back to Form1?
Is this some kind of P/Invoke job?

Regards

Jax


Feb 4 '06 #3
Simon,

Yes, it does, but I don't understand for the life of me WHY you would do
this, when you can just either show the original form, or create separate
controls. You are passing everything through to the form, as well as
displaying the form anyways.

If you REALLY want to do this, I really don't think that there is a good
way to do this.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Tamman {Uchiha Jax}"
<i_************ *************** *******@NOSPAMh otmail.com> wrote in message
news:4%******** *********@newsf e2-gui.ntli.net...
I don't want the user of the program to directly see the windows controls,
I
want to be able to capture the graphics of the controls of the hidden
form,
and overlay those graphics on Form1 (on top of another bunch of stuff i'm
drawing).
Then translate the clicks on Form1 to Form2 so that the controls are
properly updated when the graphics are next captured from Form2 and
displayed on Form1.

This is essentially a simple hack of the GUI so I can implement dynamic
graphic arrangement and not have to worry about transparency issues or
implementing WinForm control functionality.
Does this make much sense to you?

Regs

Jax
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in
message news:eA******** ******@TK2MSFTN GP09.phx.gbl...
Jax,

You can design this much better so that it is an easier operation.
Simply, have the contents of forms one and two contained in controls,
instead of forms, and then host both controls on the same form. Then,
you
don't have to worry about all of the input switching and whatnot.

Also, one might ask, why not just hide form one and then show form

two?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Tamman {Uchiha Jax}"
<i_************ *************** *******@NOSPAMh otmail.com> wrote in message
news:Ff******** ***********@new sfe5-gui.ntli.net...
> Scenario:
>
> Two System.Windows. Forms: Form1 and Form2.
> Form1 is displayed, Form2 is hidden.
>
> At this juncture, is it possible to take the graphics from Form2 and
> output
> that to Form1's display and take all of the mouse and key events from
> Form1
> and pass those on to Form2, thus changing the graphical output on Form2
> and
> then pasting those graphical changes back to Form1?
> Is this some kind of P/Invoke job?
>
> Regards
>
> Jax
>
>



Feb 5 '06 #4
The purpose was a dynamic UI where the UI would be created via an image and
a mapping file (a black and white image specifying where the controls are,
for click events).
As this isn't a main element of the project i'm not prepared to build a
dynamic UI from the ground up as I don't want to re-invent the wheel (like a
textbox, button, listbox etc) as it will take too long.
This is the reason why the idea is odd, it's a simple hack.

So the idea was to get the graphics of the WinForm controls from elsewhere,
gather that up in a bitmap, paste the image (save the transparent coloured
parts) on top, then output to the display of the visible Form.
To to get around the issue of the click events, You could then specify
what is and what isn't a click by choosing to pass the click through only
when the click point matches that of a "white" pixel in the mapping file.
If that click could then update the "hidden" form (like, the selection of an
item in the listbox) and you could capture the graphics again and update the
selection to the UI. (Whoop!)

This would be a nice hack but I don't think it will be possible.
As our accesss to the WinForm GDI is very much a Control-Up system rather
than a Top-Down form of control it's a long job to implement this the
correct way.

I'm thinking that the best i'm going to get is creating customised controls
(for each control) to support transparency and using something like MyXAML
to enable the dynamic support.

Thanks for your help though and your time considering this concept.

Kind Regards
Jax

It's a suggestion
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Simon,

Yes, it does, but I don't understand for the life of me WHY you would do this, when you can just either show the original form, or create separate
controls. You are passing everything through to the form, as well as
displaying the form anyways.

If you REALLY want to do this, I really don't think that there is a good way to do this.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Tamman {Uchiha Jax}"
<i_************ *************** *******@NOSPAMh otmail.com> wrote in message
news:4%******** *********@newsf e2-gui.ntli.net...
I don't want the user of the program to directly see the windows controls,I
want to be able to capture the graphics of the controls of the hidden
form,
and overlay those graphics on Form1 (on top of another bunch of stuff i'm drawing).
Then translate the clicks on Form1 to Form2 so that the controls are
properly updated when the graphics are next captured from Form2 and
displayed on Form1.

This is essentially a simple hack of the GUI so I can implement dynamic
graphic arrangement and not have to worry about transparency issues or
implementing WinForm control functionality.
Does this make much sense to you?

Regs

Jax
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in
message news:eA******** ******@TK2MSFTN GP09.phx.gbl...
Jax,

You can design this much better so that it is an easier operation.
Simply, have the contents of forms one and two contained in controls,
instead of forms, and then host both controls on the same form. Then,
you
don't have to worry about all of the input switching and whatnot.

Also, one might ask, why not just hide form one and then show form

two?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Tamman {Uchiha Jax}"
<i_************ *************** *******@NOSPAMh otmail.com> wrote in message news:Ff******** ***********@new sfe5-gui.ntli.net...
> Scenario:
>
> Two System.Windows. Forms: Form1 and Form2.
> Form1 is displayed, Form2 is hidden.
>
> At this juncture, is it possible to take the graphics from Form2 and
> output
> that to Form1's display and take all of the mouse and key events from
> Form1
> and pass those on to Form2, thus changing the graphical output on Form2 > and
> then pasting those graphical changes back to Form1?
> Is this some kind of P/Invoke job?
>
> Regards
>
> Jax
>
>



Feb 5 '06 #5

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

Similar topics

1
3520
by: Susan | last post by:
I have a bound form and subform and am trying to enter the data in both forms programatically. The Linkmaster and Linkchild properties are set. My intent is to be able to look at the data before it is saved and then choose to save it or undo it. I have a Save button that just closes the form and a Cancel button that does an undo and then closes the form. I first enter data into the main form and then enter code into the subform. After the...
2
6158
by: Todd | last post by:
Hello, I'm curious if anyone knows of a way (if one exists) to tell a form (in Access 2002 VBA) to sort on an unbound column of a combo box on the form. Here's what I want to do: A combo box on my form contains a category ID (bound column, not visible, long integer) for the items listed on the form and a description (unbound column, visible, string.) I can "Sort Ascending" and "Sort Descending" on the visible description in the...
1
3134
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created elements and would like to seek a solution for this. I had looked through several articles for accessing programatically-created dynamic elements such as: 1)
3
6923
by: Patrick Fogarty | last post by:
I am programming what is to be a web service client that will use an HTTP-POST to request and retrieve data. The remote server (written in java for what it's worth) requires basic authentication as per RFC 2617 (http://www.faqs.org/rfcs/rfc2617.html). My attempts to authenticate are failing. The server requires the header to be present with the request. For security reasons, it will not reply in any way if the header is not present. ...
3
4159
by: Ben Crinion | last post by:
I am creating a web service which will be available on only one of two servers at a time. Both servers will have exactly the same services running but one will be a backup which just waits doing nothing. They will both have WSDL files on with the only difference being the <soap:address location="" /> value in the <service> element. The service consumer (ASP.NET pages) will get the current live server to use from a function (call it...
3
7118
by: =?Utf-8?B?YmJkb2J1ZGR5?= | last post by:
I need to add a web reference programatically on the application's load event. Can anybody help me out with this Thanks in advance
0
1823
by: Maxx57 | last post by:
C# VS.Net 1.1 (2003) - trouble with using IE proxy server settings I've got a program that detects if it can connect to a webservice. It sends a System.Net.WebRequest and then checks the information it gets back to findout if it can connect to the service properly. If there is an error it will catch an exception and everything is fine. This used to work wonderfully, until somebody decided they needed to use a proxy server. (rats!) It's...
1
4997
by: =?Utf-8?B?Z2FsbGFu?= | last post by:
We have an application that is running fine on several of our customer’s servers. However, one of our customers is having a problem running the application. The application works on one of his Windows 2003 servers, but not on the other one. The application is a C++ .Net /clr Windows Service. It communicates with our server by sending and receiving XML using the WebClient object. The error they are receiving is “The remote server...
1
1451
by: richard | last post by:
We have developed a website using ajax toolkit in asp.net 2.0 During web development everything work fine. When we deploy at live environment, the client is using proxy server. We found out the ajax screen is not able load probably and it return error. We have un check the proxy, the website able run without any error. May i know what should i need to take consider when using ajax and client environment is using proxy.
0
8677
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
9130
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
9020
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
7879
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 projectplanning, coding, testing, and deploymentwithout 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
6603
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
5926
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
4435
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
4694
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3130
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

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.