|
Hi
There is a Usercontrol which is displayed in the modeless state.
Now i display another Usercontrol on top of the the other control and the other control is now completely invisible (it goes behind the new one i have shown now).
The invisible control has a a button control in it and it has a mnemonic set so that upon a particular key press, it will fire its Click event code.
Now when the user is currently working with the new Usercontrol that is displayed on top on the old one (which is currently invisible, but it is there), and hits a key, say "J", the old control's button control's click event gets fired. This is because the key "J" is its mnemonic. How to ensure that when that Usercontrol is not visible, the key down hit is not consumed by the hidden usercontrol's button control. and is used by the one on top - i.e. the new control.
I hav tried all sorts - OnVisibleChanged(), OnLostFocus() etc where i tried to remove hte Click event handler from teh button's click event and adding it when the control becomes visible, etc, but these do not work.
I think the only way to do that is to do something in hidden control's WndProc().
Any ideas?
|
|
|
|
|
Hello,
I have a vb code which l am trying to convert to c# and having many problems with it. PFD = rpt.DataDefinition.ParameterFields.Item("@dt"). In c# there is not a parameterFields method called Item. So i am not sure how do l get the name of my parameter that is in the crystal report viewer.
Can anyone help me convert this code to c#.
<br />
Imports CrystalDecisions.Shared<br />
Imports CrystalDecisions.CrystalReports.Engine<br />
<br />
Dim mDate As DataTime = #01/01/2005#<br />
Dim rpt As New CrystalReport1<br />
Dim PFD As ParameterFieldDefinition<br />
Dim PValues As ParameterValues<br />
Dim Parm As ParameterDiscreteValue<br />
<br />
PValues = New ParameterValues<br />
<br />
PFD = rpt.DataDefinition.ParameterFields.Item("@dt")<br />
Parm = New ParameterDiscreteValue<br />
Parm.Value = mDate<br />
PValues.Add(Parm)<br />
PFD.ApplyCurrentValues(PValues)<br />
<br />
CrystalReportViewer1.ReportSource = rpt<br />
Thanks in advance,
Steve
|
|
|
|
|
try this:
<br />
using CrystalDecisions.Shared;<br />
using CrystalDecisions.CrystalReports.Engine;<br />
<br />
DateTime mDate = DateTime.Parse("01/01/2005");<br />
CrystalReport1 rpt = new CrystalReport1();<br />
ParameterFieldDefinition PFD; <br />
ParameterValues PValues = new ParameterValues();<br />
ParameterDiscreteValue Parm;<br />
<br />
<br />
PFD = rpt.DataDefinition.ParameterFields["@dt"];<br />
Parm = new ParameterDiscreteValue();<br />
Parm.Value = mDate;<br />
PValues.Add(Parm);<br />
PFD.ApplyCurrentValues(PValues);<br />
<br />
CrystalReportViewer1.ReportSource = rpt;<br />
hope it works
|
|
|
|
|
Thanks for all your help.
PFD = rpt.DataDefinition.ParameterFields["dt"];
Have to take out the @ sign of an error message says field name does not exist.
Thanks,
Steve
|
|
|
|
|
Hello everybody .
I am developing chat / Server Application and my project worked will on my localhost and Lan but not on Wan or the internet. I posted this problem at the past and some professional programmers helped me i thank them very very much really i appreciate that from them , I Found that the windows xp has built in firewall i enabled it to access internet users to my server ports manually from my network connection properties. Ok and it works and i chatted with my friends through the internet using my application , But the problem is i need anyone install my messenger on his pc to enable these ports automatically during installation not to make the user manually enable his/her firewall . I know it must have a possible way to do that through win32 send messages function . Is there anyone knows how to send message programmatically to the firewall of windows to enable these ports through code through calling sendmessage , And if there any other methods i appreciate that from you all
Mess With The Best And Die Like The Rest
|
|
|
|
|
If you think about it, a firewall that allows programmatic access to its setup woul be pretty daft! Virus writers could quite easily circumvent the protection of the majority of computer users.
I think the possibility of doing this (at least without local admin rights) is slim to nil.
|
|
|
|
|
|
Hi coders !
I need to binary convert a byte (unsigned 8 bit, 0 to 255) to an
sbyte (signed 8 bit, -128 to 127).
I have no problem converting an array of bytes to any other
type using BitConverter.To[type] functions, but there's no
BitConverter.ToSByte ....
VS 2003 - compact framework SP3
any ideas ?
Ciao
Marco
-- modified at 9:54 Thursday 26th January, 2006
|
|
|
|
|
You can just convert it, ignoring overflow, as there is no data loss.
byte source = -42;<br />
sbyte dest;<br />
<br />
unsafe { dest = (sbyte)source; }
---
b { font-weight: normal; }
|
|
|
|
|
Are you sure ?
First off
<br />
byte source = -42;<br />
is indeed wrong since byte is UNSIGNED (0 to 255).
Second a simple cast doesn't convert BINARY the values,
meaning a 10010011 is (let's say) 215 for a byte and
-81 for a sbyte.
still looknig for help
Ciao
Marco
|
|
|
|
|
|
Just a typo. Of course a byte can't be -42.
It was unchecked (as leppie suggested) that I was going for, not unsafe.
However, some testing reveals that you can just cast the value from byte to sbyte. You don't need unchecked mode for casting between signed and unsigned data types.
byte source = 214;<br />
sbyte dest;<br />
dest = (sbyte)source;
Now dest will contain the value -42.
Marco [Stinger] wrote: Second a simple cast doesn't convert BINARY the values
What do you mean by convert BINARY, then?
---
b { font-weight: normal; }
|
|
|
|
|
It works perfectly, I did the same test
and got the same result.
By binary I meant exaclty that : having a brunch of bits read
from the sbyte point of view (so to speak)
Thanks a LOT everyone !!!
Ciao
Marco
ps: I WANT to install vs 2005 .... it's GREAT, but I have only
1 PC and some soon to be released products in VS 2003.
.... I MUST WAIT .....
.... I MUST WAIT .....
.... I MUST WAIT .....
.... I MUST WAIT .....
|
|
|
|
|
Try to use Convert.ToSByte(source);
May be this will work.
byte source =42;
sbyte dest;
dest = convert.ToSByte(source);
|
|
|
|
|
Hello all,
I have an application that performs alot of logging, as a result of this the execution time is increase by an unnacceptable amount. Unfortunatly the logging is a necessarily evil and the volume cannot be reduced
To get around this problem I placed the logging code into a typical threadpool implementation
delegate void ThreadedLogger(int logLevel, string data, Datetime logDate);
...
...
ThreadedLogger tl = new ThreadedLogger(LogWriter);
timl.BeginInvoke(1,
"log data",
Datetime.Now,
null,
null);
...
...
void LogWriter(int logLevel, string data, Datetime logDate);
{
}
Now this all works fine, and my execution times have dramatically dropped. The problem is that if the calling application exits before the the ThreadPool has finished the remaining items in the threadstack are purge and the log is never written.
Putting a wait in the code to ensure that threadpool has finished defeats the point of threading off in the first place, so i am looking for another solution. Does anybody have any ideas on possible solutions to this problem.
|
|
|
|
|
|
I created a class library and would like in one class to keep a variable of type
System.Windows.Forms.TextBox
However for some reason in the class library the namespace System.Windows is not known. Is this normal? Did I screw up a setting somewhere?
Please help me if you know what might be wrong...
Friendly Regards,
Davy
|
|
|
|
|
Just add a reference to assembly System.Windows.Forms in your class library
|
|
|
|
|
Ok that was it... Thanks a lot!;)
I'm still new to .NET so my mind didn't go that way...
Greetings,
Davy
|
|
|
|
|
First of all.. ive posted this question in 2 other forums without any luck (or responses)
so i thought id try this great forum with lots and lots of talented people
...
Ive had some problems getting the TcpListener under C# to find and accept
connections from a client with my client app and/or a simple telnet connection.
Connecting locally (localhost / 127.0.0.1) works fine but externally does not.
First i thought that it must be a firewall that was refusing the connections,
but even with it shut off (on both the server and client) i still cant get it to connect.
Has anyone had the same problem and if so, what should i do to fix it?
Im using WinXP Pro, .NET 1.1 and VS 2003.
Heres a simplified version of how i setup the tcp listener on the server:
// Initialize the tcp listener for connection clients
TcpListener tcpServerListener = new TcpListener(IPAddress.Any, 8002);
// Start the tcp listener
tcpServerListener.Start();
// Wait for an incomming connection from a client
Socket socket = tcpServerListener.AcceptSocket();
// Handle the connected client here
|
|
|
|
|
hello first my friend iam developing the same application and i had the same problems but i will solve all your problems then.
The problem in your application is
here
<br />
TcpListener server = new TcpListener(IpAddress.Any,8002);<br />
When you use IpAddress.Any
It listens for the default ip address of your windows xp even if you are connected to the internet . So you will have to make it listen for the ip address currently in use . So you will piece of code to your previous code as the following and the same for the client don't forget
<br />
IpAddress CurrentAddress = Dns.Resolve(Dns.GetHostName).AddressList[0];<br />
IpAddress CurrentAddress = Dns.Resolve(Environement.MachineName).AddressList[0];<br />
TcpListener server = new TcpListener(CurrentAddress,8002);<br />
i developed my application and i chatted with my friends through it on the internet and it works well but the problem i face now is that i need to enable the firewall immediately during installation of my messenger in their pcs through Win32 calls to SendMessage() functions but i don't know how .
If you have any solution for this it will be appreciated from you my friend.
Mess With The Best And Die Like The Rest
|
|
|
|
|
Thanks a lot for the help!
It finally works now, although i have to configure my firewall at work to let through connections as well as with a non-firewall system.
Im not quite sure i understand your problem, but perhaps something like this is
what youre asking for?
http://msdn.microsoft.com/msdnmag/issues/03/07/NET/
http://msdn.microsoft.com/msdnmag/issues/02/08/CQA/
Again, thanks for the help!
|
|
|
|
|
Thanks my friend for your help . Any Problem faces you in network programming just buzz me and send me the problem here
snouto@gmail.com
Mess With The Best And Die Like The Rest
|
|
|
|
|
i have pointer of the method with getFunctionPointer() but how can i call method using that pointer. There are no answer on hole Net and 666MSDN
winx
|
|
|
|
|