473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 1473
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.com

"Simon Tamman {Uchiha Jax}"
<i_**********************************@NOSPAMhotmai l.com> wrote in message
news:Ff*******************@newsfe5-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.com> wrote in
message news:eA**************@TK2MSFTNGP09.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.com

"Simon Tamman {Uchiha Jax}"
<i_**********************************@NOSPAMhotmai l.com> wrote in message
news:Ff*******************@newsfe5-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.com

"Simon Tamman {Uchiha Jax}"
<i_**********************************@NOSPAMhotmai l.com> wrote in message
news:4%*****************@newsfe2-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.com> wrote
in
message news:eA**************@TK2MSFTNGP09.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.com

"Simon Tamman {Uchiha Jax}"
<i_**********************************@NOSPAMhotmai l.com> wrote in message
news:Ff*******************@newsfe5-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.com> wrote in
message news:%2****************@TK2MSFTNGP14.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.com

"Simon Tamman {Uchiha Jax}"
<i_**********************************@NOSPAMhotmai l.com> wrote in message
news:4%*****************@newsfe2-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.com> wrote
in
message news:eA**************@TK2MSFTNGP09.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.com

"Simon Tamman {Uchiha Jax}"
<i_**********************************@NOSPAMhotmai l.com> wrote in message news:Ff*******************@newsfe5-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
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...
2
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...
1
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...
3
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...
3
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...
3
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
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...
1
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...

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.