|
Really? Maybe you should write an article about the subject then...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
No chance - I have no clue either; otherwise I wouldn'T have searched
|
|
|
|
|
I thought there was a splash screen component built in, but a splash screen is just a form. Use the Show method so that it doesn't stop the rest of your app from running.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I am using a lot of controls on my main form, and require the splash screen to be shown until all the controls are drawn. I am using the AppLoader Quick n Dirty in C#. I have the splash working but don't know how to make it stay until the main form has completed loading and populating a control.
Any help is appreciated.
Thanks, Andrew.
|
|
|
|
|
Hi, maybe you should use the Activated-Event of the main form. This event occurs when the form has completed loading!
Tobias
|
|
|
|
|
i want my code to accept only numbers as the input in this calculator code.....how can i do that
class Program
{
int operand1;
int operand2;
char oper;
int result;
public void Display()
{
Console.WriteLine("Enter the value of operand1");
if (operand1 < 48 && operand2 > 57)
{
Console.WriteLine("");
}
operand1 = Int32.Parse(Console.ReadLine());
Console.WriteLine("Enter the value for operand2");
operand2 = Int32.Parse(Console.ReadLine());
Console.WriteLine("Enter the oper");
oper = Convert.ToChar(Console.ReadLine());
}
public void Result()
{
switch (oper)
{
case '+':
result = operand1 + operand2;
break;
case '-':
result = operand1 - operand2;
break;
}
}
public void Displayresult()
{
Console.WriteLine("{0} ", result);
Console.ReadLine();
}
public static void Main()
{
Program obj = new Program();
obj.Display();
obj.Result();
obj.Displayresult();
}
}
}
thanks
C#
|
|
|
|
|
Use Int.TryParse() in order to check if the string is an integer
|
|
|
|
|
hi ,
thanks but can you be bit more specific ie wer should i use this
thanks
C#
|
|
|
|
|
You should use it instead of Int.Parse() Have a look at documentatio in MSDN, it shows how to use Int.TryParse()
|
|
|
|
|
Hello,
I wrote the following code to get a list of available drives letters:
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.IO;<br />
<br />
namespace drives<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
int intFirstDrive = Convert.ToInt32('A');<br />
int intLastDrive = Convert.ToInt32('Z');<br />
List<int> intAvailableDrives = new List<int>();<br />
for (int i = intFirstDrive; i <= intLastDrive; i++)<br />
{<br />
intAvailableDrives.Add(i);<br />
}<br />
<br />
DriveInfo[] usedDrives = DriveInfo.GetDrives();<br />
int x = usedDrives.Length;<br />
<br />
foreach (DriveInfo usedDrive in usedDrives)<br />
{<br />
int intUsedDrive;<br />
string strUsedDrive;<br />
char chrUsedDrive;<br />
strUsedDrive = usedDrive.Name.Substring(0, 1);<br />
chrUsedDrive = Convert.ToChar(strUsedDrive);<br />
intUsedDrive = Convert.ToInt32(chrUsedDrive);<br />
intAvailableDrives.Remove(intUsedDrive);<br />
}<br />
<br />
List<string> strAvailableDrives = intAvailableDrives.ConvertAll<string>(delegate<br />
(int intDrive)<br />
{<br />
return Convert.ToChar(intDrive).ToString();<br />
});<br />
}<br />
}<br />
}<br />
but it seems that in windows vista DriveInfo.GetDrives() doesn't get network drives, is there something I can do about it?
|
|
|
|
|
|
Hello, everyone.
I was working on a windows program with C#, and wanted to associate my PictureBox component with a ContextMenu.
I searched into the Properties Windows, only to find a ContextMenuStrip property there instead of a ContextMenu.
Then I was unable to set the property using the Properties Window which would otherwise save me a lot of troubles.
So here comes my question. Since not all the properties of a component are displayed on the Properies Window, can I manually put the ContextMenu or some other property onto the Properties window? Or there's just no way for me to customize the Properties Window like that?
-- modified at 6:25 Saturday 20th October, 2007
|
|
|
|
|
ContextMenuStrip, is just a context menu, 'they' just changed the name a little.
Make yourself a ContextMenu(Strip) then set your Picture boxes ContextMenu(Strip) to it.
And in a situation where a property is not listed in the designer, and you KNOW its there, you can just add the line of code yourself, like:
this.Thing.Attribute = Whatever;
I don't think you can just add stuff tou the properties window like that. You'd have to inherit the base class, and add in the support for the designer.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Thanks for your advice!
|
|
|
|
|
Hello,
In my application the date is stored in the table in dd/MM/YYYY. I want this date to convert based on the culture.
I have seen lot of example but they all start with current date time.
Please suggest.
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
whatever works for the current date time should also work for an arbitrary date time,
the conversion is independent of the actual value of the variable at hand.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
mpavas wrote: In my application the date is stored in the table in dd/MM/YYYY.
First of all, you should store the date as a date in the database, not text.
If you do store it as a date, it's not stored in any format at all. A date value never has a format, it's only when you render it as a string that it gets a format.
When you render the date as a string, you can specify a CultureInfo or DateTimeFormatInfo object to use, which specifies the culture or format. You can also specify an exact format string to use.
mpavas wrote: I have seen lot of example but they all start with current date time.
Yes, that's how most examples are written. They demonstrate how a method works, you just have to apply the same method to the data that you have.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
He Gufa,
Thanks for the reply. I just got the solution and it follows the same guidelines as u provided
Thanks a lot
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
I Want To Load CrystalDecisions.CrystalReports.Engine To Make The Report Load Fast
ENG.M.Yahia
|
|
|
|
|
when live messager did not login, it showed a network diagnostic tool,
how to develope a diagnostic tool like live messager's?
|
|
|
|
|
Im using C# .NET 1.1. Im scratching my head over getting the regular expression to replace only a single instance of my pattern:
searchResults = Regex.Replace(searchResults, @"(]*)>)", "$1", RegexOptions.IgnoreCase);
searchResults contains HTML tags possibly containing two or more tags. I would like to append a tag just after the first and thats it. My above regex will append the tag after every on the page. How do i get it to do only the first instance and stop?
|
|
|
|
|
Create a RegEx object so that you can specify the options using the Options property, then the number of replacements in the call:
RegEx addHidden = new Regex.Replace(@"(<form ([^>]*)>)");<br />
addHidden.Options = RegexOptions.IgnoreCase;<br />
searchResults = addHidden.Replace(searchResults, "$1<input type=hidden name='mID' value=" + this.ModuleID + ">", 1);
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Hello; Which event do I want for the following:
I would like to have a user click and hold the mouse button (left) down, and while it is held, they move a picturebox (c) around at the mouses position. Once they release, the box stays where it is.
My question is, which event is this? I didn't understand the drag events... So if anyone could help, I'd be greatly appreciative. Thanks in advance.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
You'll need to handle 3 events: MouseDown , MouseMove and MouseUp .
/ravi
|
|
|
|
|
Could you give me an example?
The most knowledge doesn't mean the most wise...
|
|
|
|