|
Whatever works! I just thought of it off the top of my head. I never said I did it myself!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
No worry, without your idea, I'd've probably spent more time searching for what I ended up doing than I lost starting to implement the innerface.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
I have a web page where the user selects a month and year and submits it to the system.
I then need to create two dates - the first and last dates of that month - which are then sent to another page.
Whats the best way to do this ? I came up with the idea of subtracting the month from todays month, doing the same with the year and then creating the start date.
But this involves converting a string -> int -> date and then back to string - which seems like a lot of converting.
|
|
|
|
|
Use the DateTime.DaysInMonth to get the number of days in the month. Then you can easily create DateTime structures from the values, and format the dates as you like them.
---
b { font-weight: normal; }
|
|
|
|
|
This looks suspiciously homeworky . Anyway, here's the easy way to do it:
DateTime startDate = new DateTime(selectedYear, selectedMonth, 1, 0, 0, 0, 0);
DateTime endDate = startDate.AddMonths(1).AddDays(-1);
You can use a similar trick to get the first and last days from any date:
DateTime dt = new DateTime(2006, 11, 26,0,0,0,0);
DateTime startDate = dt.AddDays((-(dt.Day)) + 1);
DateTime endDate = startDate.AddMonths(1).AddDays(-1);
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
In some codes I saw @ character before string. I here that it is used in php sytax for breaking loops, but could not found any clue what it does in c#
karanba
|
|
|
|
|
Makes it so escape characters are skipped.
string x = "What now man? \nWe are going to the store";
Console.WriteLine(x);
will output:
What now man?
We are going to the store
whereas this:
string x = @"What now man? \nWe are going to the store";
Console.WriteLine(x);
will output:
What now man? \nWe are going to the store
|
|
|
|
|
thaks much.
karanba
|
|
|
|
|
A @ delimited string has the double quote as only escape code.
These declarations are equivalent:
string a = "A string with \"quotes\" and a backslash: \\ in it.";
string b = @"A string with ""quotes"" and a backslash: \ in it.";
---
b { font-weight: normal; }
|
|
|
|
|
I also use it for creating multiline strings
string sql = @"
SELECT *
FROM TABLE
WHERE THIS=@THAT
";
|
|
|
|
|
Hi,
I am trying a simple window program in C#. That application should be in system tray and show the window when the icon in the tray is clicked. How can i do this?
urs truly,
Mutyala Rao,
9980004568
|
|
|
|
|
Mutyala Rao wrote: How can i do this?
Do a little research.
There are plenty of articles on the subject here.
only two letters away from being an asset
|
|
|
|
|
There's a controol available called NotifyIcon... Try experimenting with this one
|
|
|
|
|
hi thanks.
the below links were helpful:
http://www.developer.com/net/csharp/article.php/3336751
http://bluehouse.wordpress.com/2006/01/24/how-to-create-a-notify-icon-in-c-without-a-form/
urs truly,
Mutyala Rao,
096886303653
|
|
|
|
|
I had set some shortkut keys by using &in front.But the underline is enabled only if i press the alt key.i hav to see the menus with underline before press the alt key.please help me
My small attempt...
|
|
|
|
|
Display properties -> Appearance -> Effects -> Uncheck "Hide underlined letters..."
Don't use urgent in the subject
only two letters away from being an asset
|
|
|
|
|
i know that.But is der any other method
My small attempt...
|
|
|
|
|
No, there isn't. This is a user-controlled setting in the system, not your application. You don't have any control over the appearance of that underline in your application, unless you are owner-drawing the menus yourself. But, that's a lot of work just to show a stupid underline in a menu.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thanks a lot dave.I were trying to change the registry thru pgm
My small attempt...
|
|
|
|
|
I have a list view control that is populated with "text" names of files on an ftp server. I want to allow the user to drag one of these names onto an area (like a folder), and copy the file from the ftp server. Is that possible?I have the QueryContinueDrag which tells me when the mouse is released, but is it possible to know where it was released? Also, I get the no drop icon. Can I change that as well? All I need to know from the user is, which directory he wants to drop the file, and I can do the rest. So basically, I need to,
1. Make sure the user has dropped the file on an explorer window
2. what directory was that explorer window pointing to?
thanks
|
|
|
|
|
Hi, I am wondering if any body has tried priting Images 2 or more per page depening on the user selection to print. LIike in Ms power point slide.
Thanks
|
|
|
|
|
Tried and completed.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
|
Count me in, I've done it too!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
And me.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|