|
Set the opacity to 0 in the form properties.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It's a problem in your calling code, not the form itself. You can create a form by calling it's constructor, everything will happen then (if written properly) but it will not be visible.
|
|
|
|
|
if you want your form invisible, why use form? i mean how about just create an object that hold all information (field, method, properties) of your "invisible form".
hope it helps.
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
The "why" is irrelevant. If you can't help the guy, refrain from posting.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Just make a suggestion. If you don't need a visual object why you use that?. You can create an object substantially similar of "invisible form" and you don't have to set Visible property to false.
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
You don't see to get it. The original poster asked how to do something - NOT for alternatives to what he was doing or opinions about his coding. Answering someone's question AS POSTED is a lot more important that trying to prove you're clever (which you aren't).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
so you are clever enough with your answer : 'Set the opacity to 0 in the form properties.'
don't be rude dude.
John Simmons / outlaw programmer wrote: a lot more important that trying to prove you're clever (which you aren't).
I don't need to prove that I'm clever or not. I know you are MVP in CP, IMO nothing special with your knowledge. In this forum, peoples can share all possible answer to help others as you do with writing all your articles. aren't you?
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
John Simmons / outlaw programmer wrote: Answering someone's question AS POSTED is a lot more important that trying to prove you're clever
Many people don't know what to ask for, how to ask for it, or where to ask for it. If you only ever answer exactly what people ask for, you often can not give them the answer that they want, or the answer that they need.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I agree with you dude.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Guffa wrote: Many people don't know what to ask for, how to ask for it, or where to ask for it
If a person's communication skills aren't adequate, maybe they should learn better English. That *is* the language used on this site.
Guffa wrote: If you only ever answer exactly what people ask for, you often can not give them the answer that they want, or the answer that they need.
How could that guys question have been interpreted as "give me an alternative". He wanted to set the form to be invisible when it started up. I gave him the solution to *that* question. I don't care why he wants to do it.
I do some pretty whacked out stuff myself (like most of us have), and I personally don't like being quizzed as to my motives, or have some nimrod in a foreign country second-guessing me - I just want an answer to the question I posted. If you can't get your pointed little heads around that concept, then please don't answer my questions.
In any case, this conversation doesn't belong in this forum.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
In MSDN guide convert array bytes to string, here code: Encoding.UTF8.GetString(byte[] bytes) VS2005 doesn't support convert one byte to string.
Anybody can I help me? or for example how to convert one byte to string. Although, may be use to Convert.ToString(byte) is correct, but I don't think so. Except, differently another way
Thank one so much!!!!
|
|
|
|
|
Encoding.UTF8.GetString(byte[] bytes) is working. did you try the method Tostring();
|
|
|
|
|
Just make a byte array with only this byte in it.
GetString(new byte[] { myByte });
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
If you encode a single character into bytes using the UTF-8 encoding, it can result in more than a single byte. It wouldn't make sense to have a method that decodes a single byte, as that would only work on a very limited part of the character set.
If you have a character that actually was encoded into a single byte, you just have to put that byte in an array to decode it.
If you are trying to decode data byte by byte, that doesn't work, as some characters may need more than one byte of the data.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: If you have a character that actually was encoded into a single byte, you just have to put that byte in an array to decode it.
If you have a character that was encoded into a single byte using UTF8, then it was an ASCII character.
Instead of allocating lots of small byte arrays, you can just do this:
char DecodeASCII(byte b)
{
if (b >= 128)
throw new ArgumentException("This is not a single-byte character");
else
return (char)b;
}
|
|
|
|
|
this is the code i use to encrypt the "ser.xml"and send it to the server.
but when trying to decrypt this at server i get the exception "Unable to cast object of type 'System.Security.Cryptography.RSACryptoServiceProvider' to type 'System.Security.Cryptography.SymmetricAlgorithm'."
private void encrypt_msgxml()
{
XmlDocument xmldoc = new XmlDocument();
XmlElement element_to_enc;
Rijndael sessionkey;
EncryptedXml enxml = new EncryptedXml();
byte[] encryp_bytes;
byte[] encrypt_keyarray;
EncryptedData encrypt_element;
xmldoc.PreserveWhitespace = true;
xmldoc.Load("ser.xml");
element_to_enc = xmldoc.GetElementsByTagName("message")[0] as XmlElement;
sessionkey = new RijndaelManaged();
sessionkey.KeySize = 256;
encryp_bytes = enxml.EncryptData(element_to_enc, sessionkey, false);
encrypt_element = new EncryptedData();
encrypt_element.Type = EncryptedXml.XmlEncElementUrl;
encrypt_element.EncryptionMethod = new EncryptionMethod(EncryptedXml.XmlEncAES256Url);
EncryptedKey encrypt_key = new EncryptedKey();
encrypt_keyarray = EncryptedXml.EncryptKey(sessionkey.Key, rrsa, false);
encrypt_key.CipherData = new CipherData(encrypt_keyarray);
encrypt_key.EncryptionMethod = new EncryptionMethodEncryptedXml.XmlEncRSA15Url);
encrypt_element.KeyInfo = new KeyInfo();
KeyInfoName kin = new KeyInfoName();
kin.Value = "cli_ser_pub_key";
encrypt_element.KeyInfo.AddClause(kin);
encrypt_element.KeyInfo.AddClause(new KeyInfoEncryptedKey(encrypt_key));
encrypt_element.CipherData.CipherValue = encryp_bytes;
EncryptedXml.ReplaceElement(element_to_enc, encrypt_element, false);
xmldoc.Save("test.xml");
}
this is the code to decrypt.(i have created the rsa object in the server )
public void decrypt_msgxml()
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load("test.xml");
EncryptedXml exml = new EncryptedXml(xmlDoc);
exml.AddKeyNameMapping("cli_ser_pub_key", rsa);
exml.DecryptDocument();
}
can you tell me the reason for this.
|
|
|
|
|
prasadbuddhika wrote: can you tell me the reason for this.
Before trying encryption, learn the difference between asynchronous and asymmetric. Neither of which you are using as far as I can tell.
|
|
|
|
|
this link[^] may helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Hi,
VS2005 Winforms.
Im creating a form which has a panel which can hold a number of different user controls.
The user control to display is decided at runtime.
To give a more professional look I want the user controls to fade into view.
Ive seen how this is possible on winforms using the opacity property.
Is there any way of achieving this on user controls also?
Many thanks,
Chas
|
|
|
|
|
Maybe you could create a bitmap that has the background color of the form, position it over the control, and fade the bitmap off (instead of fading the control on).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
The Opacity property only works for an entire form, not individual controls.
|
|
|
|
|
|
That works in WPF, not Windows Forms. There's a (huge) difference...
|
|
|
|
|
Like I said it was a quick search. Here's a link where WPF is not even mentioned. And it is not easy to do, but I know there is a way since several 3rd party control libraries do support transparent controls:
https://dotnetcentral.net/Weblog/posts/247977.aspx[^]
|
|
|
|
|
Oh I know it can be done, just not without writing your own drawing code for each control you want to be transparent. That's quite a lot of work for something that's rarely a functional requirement.
|
|
|
|