|
Thanks so much for sticken with me on this...
Okay the thing is the modal forms are mostly transparent in nature.. With only the buttons being visible. It's kinda weird but it's for a theme I am going with on this touchscreen. To do fading in and out and have the buttons at half opacity. If the form isn't modal and the transparent part of the form get's clicked the form will actually lose focus and the form below it will end up receiving the click event. This is not good.
I guess my example might be kinda complex.. I have a main form Form1. which then loads a graphics screen [Form2] which fades from the main screen to itself going from 0 to 100 opacity. Then the buttons on a transparent form[which are actually just pictureboxes set up to act like buttons] fade in over Form3 but only to 60% opacity.
See now if the user was now to use the touchscreen in this state and the user was to touch something that wasn't a button on Form3 [ie. the transparent area]. The event would not be caught by Form3 but by Form2.
Which means Form3 now lost it's focus.
I am going isane trying to figure this out. If you could help me I can't even explain how helpful that would be.
Thanks very much.
Steve
|
|
|
|
|
gekoscan wrote:
If the form isn't modal and the transparent part of the form get's clicked the form will actually lose focus and the form below it will end up receiving the click event
That's where I don't see why you don't handle the focus yourself with a non-modal Form. Even with a non-modal Form, you can subscribe to a lot of Form or simple control events and act accordingly.
The trouble with modal Forms is they have each a running ThreadContext attached to it, so you've got to either :
- let the modal Form workflow work as expected, (even if you add a few tweaks such as the DialogResult stuff)
- hack the ThreadContext to make sure internals are properly synchronized (so you don't end up with an exception).
- or simply catch those exceptions with a try{}catch(){} container (!)
All of this sounds ugly enough to me.
|
|
|
|
|
i want to send some messages programatically to all computers of the network using
some socket programming and a perticuler port say (999).
is it possible that i send this message using broadcaste ip like 192.168.0.255:999.
when i use this command on command prompt then it sends message on all computers of the network
------------------------
net send * some message
------------------------
in the above command what does * means?
what is the value of this ip address is?
r00d0034@yahoo.com
|
|
|
|
|
The best thing here IMO would be to use a multicast sender/reciever.
mcastSend.cs
using System;
using System.Net;
using System.Net.Sockets;
namespace multiCastSend
{
class send
{
send(string mcastGroup, string port, string ttl, string rep)
{
IPAddress ip;
try
{
Console.WriteLine("MCAST Send on Group: {0} Port: {1} TTL: {2}",mcastGroup,port,ttl);
ip=IPAddress.Parse(mcastGroup);
Socket s=new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
s.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership, new MulticastOption(ip));
s.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastTimeToLive, int.Parse(ttl));
byte[] b=new byte[10];
for(int x=0;x<b.Length;x++) b[x]=(byte)(x+65);
IPEndPoint ipep=new IPEndPoint(IPAddress.Parse(mcastGroup),int.Parse(port));
Console.WriteLine("Connecting...");
s.Connect(ipep);
for(int x=0;x<int.Parse(rep);x++)
{
Console.WriteLine("Sending ABCDEFGHIJ...");
s.Send(b,b.Length,SocketFlags.None);
}
Console.WriteLine("Closing Connection...");
s.Close();
}
catch(System.Exception e) { Console.Error.WriteLine(e.Message); }
}
static void Main(string[] args)
{
new send("224.5.6.7", "5000", "1", "2");
}
}
}
mcastRecv.cs
using System.Net.Sockets;
using System.Net;
using System;
namespace multiCastRecv
{
class recv
{
recv(string mcastGroup, string port)
{
Socket s=new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPEndPoint ipep=new IPEndPoint(IPAddress.Any,int.Parse(port));
s.Bind(ipep);
IPAddress ip=IPAddress.Parse(mcastGroup);
s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(ip,IPAddress.Any));
while(true)
{
byte[] b=new byte[10];
Console.WriteLine("Waiting for data..");
s.Receive(b);
string str = System.Text.Encoding.ASCII.GetString(b,0,b.Length);
Console.WriteLine("RX: " + str.Trim());
}
}
public static void Main(string[] args)
{
new recv("224.5.6.7","5000");
}
}
}
WebBoxes - Yet another collapsable control, but it relies on a "graphics server" for dynamic pretty rounded corners, cool arrows and unlimited font support.
|
|
|
|
|
Hi all,
I am creating a custom user control (inherited from the UserControl class), and I would like to mimic the behaviour of the standard Button control.
When you set the Text property of the Button to '&Close', the button shows: 'Close'. When you press ALT+C when the form is active, the button will receive a click event.
Does anyone has an idea about how to accomplish this?
Greetz,
Jan
|
|
|
|
|
|
Thanx for your reply. But I want to have all the needed code in my new User Control, just like the standard button.
When you place a standard button on a form, and set the the text to '&Close', the click event will be called whenever the alt+c keys are pressed (and the form has focus). Even if the current focus is in a textbox on that form for example.
Any idea's??
Jan
|
|
|
|
|
|
(Thx again)
But can the form catch all the keypresses, even if the keypreview property is set to false??
Thanks for your time...
Jan
|
|
|
|
|
i want to get the ip address of all computers on a network
that have this broadcast address 255.255.255.0.
is there any method or tecnique available available to get that ?
if i have to send a message to all computers on a network through
a net send command what ip address i have to mentation ?
i have two computers that have these ip addresses 192.168.0.1
and second one is this 192.168.0.96.
because when i do this on command prompt this appears.
D:\Documents and Settings\super>net send 255.255.255.0 hell
An error occurred while sending a message to 255.255.255.0.
The message alias could not be found on the network.
More help is available by typing NET HELPMSG 2273.
D:\Documents and Settings\super>net helpmsg 2273
The message alias could not be found on the network.
EXPLANATION
This message alias could not be located.
ACTION
Check the spelling of the message alias. If it is correct, then the computer tha
t is to receive your message may be busy. Try sending the message again later.
r00d0034@yahoo.com
|
|
|
|
|
|
can u tell how to do it in a program ?plz tell simple code i will be very thank full?
r00d0034@yahoo.com
|
|
|
|
|
I was just wondering if someone could tell me why an imagelist has such small storage.. Isn't it bad to reference a just a .bmp from a peice of software.. How can i make it hidden if it won't fit in a Imagelist??
Thanks
|
|
|
|
|
Hi all,
I am developing this image edit application. I want to provide undo and redo of actions - rotate, scale and crop. Any suggestions on what will be the best way to implement this ? I am more interested on the undo implementation after a crop.
Keeping a backup image in memory can be one option. But when it comes to undo-ing multiple actions, it might become inefficient
Smitha
Whenever I see an old lady slip and fall on a wet sidewalk, my first instinct is to laugh. But then I think, what if I was an ant, and she fell on me. Then it wouldn't seem quite so funny.
|
|
|
|
|
Smitha Vijayan wrote:
Keeping a backup image in memory can be one option. But when it comes to undo-ing multiple actions, it might become inefficient
I would keep two images in memory, the original and the current version. Then each time you perform an operation on it create and store some data that tells what that operation was. When you undo something, take the last operation off the stack of operations, then starting with the original image perform each operation.
You may want to limit the number of operations allowed to be undone, or come up with some other variant of that (every 8-32 operations create a new 'starting' image, etc).
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Thanks James.
James T. Johnson wrote:
You may want to limit the number of operations allowed to be undone
I intend to do that
Smitha
Whenever I see an old lady slip and fall on a wet sidewalk, my first instinct is to laugh. But then I think, what if I was an ant, and she fell on me. Then it wouldn't seem quite so funny.
|
|
|
|
|
Hey what's up everyone..
I recently compiled a product using release instead of debug and tried to run it on a machine without VS.net. It gives me some errors... for some reason the exe didn't include some of the .dll's needed for the actual .exe to run.
If someone could point lme in the right direction that would be awesome.
Thanks...
|
|
|
|
|
Hey nascokeg!
Do you have .net runtime over the target machine?
|
|
|
|
|
Hey thanks for your reply... hmm.. the .net runtime?
I have windows XP on the machine but I am not sure what you are refering to?
Could you help me out? LOL you are probably thinking o man what this guy must be retarded.
Thanks very much.
|
|
|
|
|
Well, let me start by saying you cannot run .NET programs on computers that do not have the .NET runtime, it is around 23mb and can be downloaded from microsofts website[^] and it contains all the .dlls required to run .NET apps. I hope this helps you...
Why waste time learning when ignorance in instantaneous
-Hobbes
|
|
|
|
|
I am attempting to place a font over some pictureboxes on my form.
But for some reason..
In my OnPaint function:
Font font = new Font("Trebuchet MS", 24,FontStyle.Bold);
Graphics g = Graphics.FromHwnd(this.Handle);
g.DrawString("Text on the Screen", font, new SolidBrush(Color.White),0,0);
This paints behind the picture boxes on my form..
Can someone tell me how to set the zorder or something... i find it kind of weird... But i have an idea that it has to do with the handle I am grabbing..
Thanks Everyone...
|
|
|
|
|
gekoscan wrote:
Graphics g = Graphics.FromHwnd(this.Handle);
Maybe you can try:
Graphics g = pictureBox1.CreateGraphics();
That gives you the graphics object to paint ON the picture box instaed of the form.
I hope this helps!
Smitha
Whenever I see an old lady slip and fall on a wet sidewalk, my first instinct is to laugh. But then I think, what if I was an ant, and she fell on me. Then it wouldn't seem quite so funny.
|
|
|
|
|
How, usually, do you all solve this problem? I'm of course referring to inserts with an apostrophe (single quote) in them.
I have some ideas on how to solve it - either to use a Replace type method or to write a stored procedure (I'm using Access, so it should be one of those Access Query things).
Is there a standard approach which is best?
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
afronaut wrote:
Is there a standard approach which is best?
I will assume you are using C# since you are posting in this forum, however I always typically write a little function to handle this as it can be used throughout an application. Another Access Query really isn't necessary for something like this. Something like the following works well in C#:
string CleanSql(string s)
{
return s.Replace("'", "''");
}
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
We use stored procedures and set up the parameters with, for example "O'Mally", just as they are and it all works swimmingly.
Philip Painter
|
|
|
|