|
That's good work. I've just created a form, fixed single without min and max buttons and it definitely doesn't maximise on double clicking the titlebar.
Regards,
Rob Philpott.
|
|
|
|
|
I want to have my form title on the left side of the title bar as usual... but I also want to have a form ID like FRM123 on the right side on the form just beside the minimize button or right most if no buttons..
how can I do that?
|
|
|
|
|
jrahma wrote: form ID like FRM123
That will be a very unprofessional thing to do
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
can I ask why?
it will be easier to identify the form specially when supporting basic users on the phone..
|
|
|
|
|
String s ="";
int? nullint = s ( How to convert "String s" to "nullable int")
|
|
|
|
|
|
First, I'd avoid nulls unless absolutly neccesary, the can cause all sorts of problems if they are not coded against.
The exact code you need depends upon your desired "failure mode" (see comment in block) but here is an answer:
static int? Convert (string value)
{
if (string.IsNullOrEmpty(value))
return null;
int returnedInt;
if (int.TryParse(value, out returnedInt))
return returnedInt;
return null;
}
also IMO nullint is a shoud be renamed as it has both "null" and "int" in it, as well as not being very descriptive.
[Edit]
Nuri Ismails post (below) achieves the same as the above, but is more compact, so I'd use that in preference.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
modified on Wednesday, January 20, 2010 9:00 AM
|
|
|
|
|
How about something like this:
public int? ToNullableInt32(string s)
{
int i;
return (Int32.TryParse(s, out i)) ? i : null;
}
String s ="";
int? nullint = ToNullableInt32(s);
|
|
|
|
|
Hi All,
I am trying to develop a .net framework v2 webservice suitable to receive a .pdf as a MIME attachment.
I have search the web but I can't find anything related.
Could you please assist
Tony
|
|
|
|
|
Hi,
In my program i'm trying to access a server drives details from my machine with different username and password, for this i'm using the connections options class in C#,
here is the code i'm using
try
{
ConnectionOptions opt = new ConnectionOptions("MS_409", "USERNAME", "PASSWORD", "ntdlmdomain:DOMAIN", ImpersonationLevel.Impersonate, AuthenticationLevel.Default,false, null, TimeSpan.MaxValue);
ObjectQuery query = new ObjectQuery("SELECT FreeSpace, Name FROM Win32_LogicalDisk WHERE DriveType = 3");
ManagementScope scope = new ManagementScope("\\\\" + "16.106.64.108" + "\\root\\cimv2", opt);
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection coll = searcher.Get();
foreach (ManagementObject ms in coll)
{
Console.WriteLine(ms["Name"]);
Console.WriteLine(Convert.ToDecimal(ms["FreeSpace"]) / 1024 / 1024 / 1024);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
whenever i reach line "ManagementObjectCollection coll = searcher.Get();" i'm getting the "Invalid Parameter" error, i could not find a slution for this, please help.
Thanks,
D.Vinoth
|
|
|
|
|
You wrote:
... i'm trying to access a server drives details from my machine with different username and password for this ...
Don't you have to change the value "ntdlmdomain:DOMAIN" also to a valid domain on the remote machine?
Sorry thats the only idea I have. Everything else seems to be right and your query works also on my system.
Greetings
Covean
|
|
|
|
|
Thanks for your reply covean,
I changed the value from "ntdlmdomain:DOMAIN" to "ntdlmdomain:AMERICAS", but still it is also not working.
Thanks,
D.vinoth
|
|
|
|
|
Hi,
i want my installation to add a shortcut of my application to the desktop accordig to user preference.
(check box of - create a desktop shortcut).
i know how to add it automatically but i couldn't find how to make the checkbox.
can it be done?
thanks,
Samy
|
|
|
|
|
You may wish to customize your setup code a little, perhaps you can use this tutorial and add shortcut & checkbox yourself... link[^]
Dax Frost
There Are 10 Kinds Of People,
Those That Understand Binary,
And Those That Don't
|
|
|
|
|
I think that this[^] article is what you are looking for.
Cheers
|
|
|
|
|
Hi. I just need help on whats the most commonly used LISP programming software and where can i possibly find an installer for that. I just need it for my class that discusses about STRUCTURE OF PROGRAMMING LANGUAGES and our project is that we need to compare a program created in LISP and in C#. C# is the main programming language that is currently taught in our school and our professor's objective is to let us learn new programming languages besides C# and to see the advantages and disadvantages of both programming languages.
Can someone help me? I'm currently confused because when I tried to search for LISP programming languages I can't determine which is commonly used and what's not.
Please consider my post even if it's not really related to C# programming. Thank you.
|
|
|
|
|
|
i have to execute 3 *.exe using a project.
i used System.Diagnostics Process to run the existing exe.
i checked for running process since one exe cannot be run twice
now the problem i am havin is that i cannot bring already running process as Windows foreground after i switch to another window.
how can i set a running process as a foreground window??
SUCIL
|
|
|
|
|
|
Hi all, I'm new to Windows Mobile 6 and C# programming, I'm currently using the Microsoft SQL Server Compact Edition and have created the database programmatically. May I ask how to export the contents of datagrid to excel or csv. I gratefully appreciate for any help. Thanks in advance.
codenoobie
|
|
|
|
|
|
|
Hello Experts,
I would like to use
object System.Xml.Serialization.XmlSerializer.Deserialize(System.IO.StreamReader stream) within a constructor
public class MyObject()
{
public MyObject (string fileName)
{
System.IO.StreamReader readingStream = new System.IO.StreamReader(fileName);
System.Xml.Serialization.XmlSerializer readingSerializer = new System.Xml.Serialization.XmlSerializer(typeof(MyObject));
MyObject justRead = (MyObject)readingSerializer.Deserialize(readingStream);
}
} But I don't know what to do with justRead.
Of course, I could just forget about the constructor and use a method
public static MyObject Load (string fileName)
But is it really impossible to create something usable like this one?
MyObject iLoadedThisFromFile = new MyObject (storageFileName);
Ciao,
luker
|
|
|
|
|
The easiest way would be to copy the variables of justRead to the variables of your new class.
Example:
this.Prop1 = justRead.Prop1;
this.Prop2 = justRead.Prop2;
...
this.PropN = justRead.PropN;
So you construct your new class out of an old class of the same type (works teh same like a copyconstrutor).
Hope that helps.
Greetings
Covean
|
|
|
|
|
Hi,
I have a stored proc that at the end executes the following line:
Select @ID
In my C# I have the following to try and grab it:
SqlParameter AgentID = new SqlParameter("@ID", SqlDbType.Int, 4);
AgentID.Direction = ParameterDirection.ReturnValue;
sqlCmd.Parameters.Add(AgentID);
int NewAgentID = 0;
try
{
sqlCon.Open();
sqlCmd.ExecuteScalar();
sqlCon.Close();
NewAgentID = int.Parse(sqlCmd.Parameters["@ID"].Value.ToString());
return NewAgentID;
}
In debug this seems to set NewAgentID to -1, however it should be a legitimately returned variable from the stored proc, any ideas what is wrong?
|
|
|
|