|
I want to dispaly empty datetimepicker, which means don't want to display today date as default in C#.NET windows application.
Plz Reply.
Jo
|
|
|
|
|
Set the DateTimePicker.Format property to Custom and DateTimePicker.CustomFormat property to space.
|
|
|
|
|
But i want to do in runtime.....
Jo
|
|
|
|
|
You can do this at runtime. What is the problem?
|
|
|
|
|
In addition to what d@nish said, you must initialize the value to DateTime.MinValue, and in the methods which use this value, make sure it's not DateTime.MinValue - this ensures the user has selected a date.
Also, in your dateTimePicker1_ValueChanged handler, use dateTimePicker1.Format = DateTimePickerFormat.Long; or whatever format you want - otherwise the user will see an empty box, no matter what he selects!
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
|
I need to support SNMP Protocol in my project.
I wrote my project in C# ( VS 2008 ) - and i dont find a way to support the SNMP.
Someone can help ?
|
|
|
|
|
You should have researched that before choosing your platform.
|
|
|
|
|
I know ... but now i did not.
|
|
|
|
|
|
Hi,
i'm beginner in MODBUS, so please help me.
i have a temperature regulator with MODBUS communication.
For example:
If i want to read holding register e.g.: 0042 „Value of temperature“ from mentioned device, in my application for MODBUS-RTU communication which i was writte in
Microsoft Visual Studio 2005- VC#,
i made request -byte array:
{0x01, 0x03, 0x00, 0x29, 0x00, 0x01, 0x83, 0x01}
1- slave adress (configured in device)- 0x01
2.- function code(Read Holding Registers)- 0x03
3.- start adress Hi- 0x00
4.- start adress Lo- 0x29
5.- no. of registers Hi- 0x00
6.- no of registers Lo- 0x01
7.- error code- 0x83
8.- exception code- 0x01
and sent that array to device. Label Rx blinks ,on the front panel of device, so device received my request, but i don't get any response, Tx doesn't blink!!!
For example:
If holding register 0042 „Value of temperature“=555, response message from device should be:
{slave adress=0x01, function code= 0x03, byte count= 0x02, register value Hi= 0x02,
register value Lo= 0x2B,... } !!!????
But i get nothing!!!!
All other parameters like port name, baud rate, parity, data bits, stop bits,ReadTimeout, WriteTimeout and RS485/RS232 converter are O.K.
Plese, could You help me with some advice to get response from device and tell me what i do wrong.
Is my request -byte array O.K.??? (especialy last two bytes 0x83, 0x01- CRC)
Thank You very much.
Best regards!
|
|
|
|
|
Without seeing any code or knowing what transmission media that you're using, it's difficult to say with any certainty where the problem is.
Try using this[^] to check your CRC bytes. Here[^] has some links to tools that may help you.
Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|
|
what tool is available for coding rules ?
|
|
|
|
|
|
|
|
|
Hello everyone,
I am using the following code to retrieve the string content of XML, my question is why there is many trailing zeros in variable content? How to solve it?
static void Main(string[] args)
{
MemoryStream MemoryStream1 = new MemoryStream();
StreamWriter StreamWriter1 = new StreamWriter(MemoryStream1);
XmlTextWriter XMLWriter1 = new XmlTextWriter(StreamWriter1);
XMLWriter1.WriteStartDocument();
XMLWriter1.WriteStartElement("Entity");
XMLWriter1.WriteAttributeString("node", "Hello Node");
XMLWriter1.WriteEndElement();
XMLWriter1.WriteEndDocument();
XMLWriter1.Flush();
string content = Encoding.UTF8.GetString(MemoryStream1.GetBuffer());
return;
}
thanks in advance,
George
|
|
|
|
|
|
Thanks leppie,
It works!
regards,
George
|
|
|
|
|
Hi! All
I m working on a project who has images, icons defined in Resources Properties. All these loads at run time. but when i remove some images from Resources then it prompts error messages. I want to handle it if the image exist then it appears if it does not exist then does not.
Let me tell how to Handle this
these are accessed as
this.BackGroundImage = MyProject.Properties.Resources.Logo;
it is ok
when i remove "logo" from Resources.
then a compile time error: logo is identified.
* So far i handle this. as i make an empty image with same name i removed.
but that is the not a solution.
Any suggestion regarding this. will be anticipated.
Thanks in advance.
|
|
|
|
|
Instead of linking the file at compile time, you can embed it in the .resx file. There will be a Persistence property for the image when you open the Resources.resx file in IDE.
Also, If you want to remove the image, you can remove it from resources also, why you want to keep it if its not used?
*jaans
|
|
|
|
|
Hi.
im currently stuck in a small problem which i cant seem to overcome
i have built a small easy tracking service which runs with timers and takes the current address from internet explorer bar and writes it on a notepad
im using a refference for .COM internet controls 6 -> shDocVw.ShellWindows
now, when i compile the program-it works perfectly fine (i even tried to build it on a webform it runs smoothly with no problems at all)
But when im trying to run the service after installing it with installutil
i get the error "COM object with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is either not
valid or not registered"
and it get closed by itself
any magical solutions???
thanks alot!
|
|
|
|
|
When u make a function call, all the value type of the calling function are pushed in stack. As soon as function returns control, the value types & memory used by variables inside function got released.
string and object are refrence type.
class A
{
string abc = "";
...
...
...
}
class B
{
A obj = new A();
obj.abc = "Value";
}
class C
{
A obj = new A();
}
Now sequence in which these class got called is A->B->C.
What happen to value i stored in abc during class B, does It got restore to default by C class obj creation.
What is the scope of variables declare at class level, as soon as control comes out from a class does they restore to default?
Thanks & regards.
|
|
|
|
|
Jon Skeet has an excellent article here[^]. It's worth reading.
|
|
|
|