|
Where can I find a composite list of special characters that I can use when printing out info on a windows form? For instance, if I wanted to tab over, what would I use? What about a carriage return/single-line break? |
| MigrationUser 1 Tuesday, March 25, 2003 9:46 AM |
I can really use the shortcuts for a forced character return and a tab. In HTML I would use a <br> for a return and &tab; for a tab. In C#, I know that \n works for a return. What is it for each of these in VB.Net? |
| MigrationUser 1 Wednesday, March 26, 2003 12:25 PM |
If you're in VB, you can still use the old vbCrLf (Visual Basic Carriage Return Line Feed)
I believe you can also use System.Environment.NewLine |
| MigrationUser 1 Wednesday, March 26, 2003 4:19 PM |
There is no new character? What is the tab shortcut? |
| MigrationUser 1 Thursday, March 27, 2003 6:46 AM |
Not in VB.NET. This is one place the C# folks have it better--and it's 1986 technology! The \n, \t, and so on provided by C# comes directly from C. I really, really wish VB.NET had the same sort of thing. It's way harder in VB.NET to get the same effects. You can either go back to the vbCrLf (and so on), which feels so, well, last year; you can use the specific character values, or you can use C#. Environment.NewLine is the only .NET FRamework constants like that I use. |
| MigrationUser 1 Thursday, March 27, 2003 9:13 AM |
That's what I figured. What's the old tab shortcut? |
| MigrationUser 1 Thursday, March 27, 2003 9:24 AM |
Chr$(9) is the old Tab char (or vbTab). |
| MigrationUser 1 Thursday, March 27, 2003 11:14 AM |
I was corrected a long time ago by someone (I think on GDN) and as time has gone by, I've come to agree: Everything in the Microsoft.VisualBasic Namespace is not old and is not around for backwards compatibility.
Got this quote from a guy at Macromedia, but it's appropriate for here too:
"If people use the feature, it will stay"
So don't feel bad or anything about using vbTab, vbCrLf, etc ;) |
| MigrationUser 1 Thursday, March 27, 2003 11:22 AM |
Thanks guys! Maybe that should be a suggestion for a future version? ;) |
| MigrationUser 1 Thursday, March 27, 2003 11:36 AM |
Erik:
Could be, but I find myself converting code back and forth to and from C#, for demo purposes. If I use those things, I have to fight the C# developers' negative feelings about referencing and using the VB.NET Runtime assembly. So, I tend not to use VB-only features. Just me, perhaps. |
| MigrationUser 1 Thursday, March 27, 2003 11:42 AM |
Ken, I tend to agree, however, quite honestly, I think it's really too bad that a lot of the stuff that's in the Microsoft.VisualBasic library isn't in C#. Lord knows, none of the hard core guys will touch it (like you said), which is silly. It's just another Assembly, there's nothing wrong with it! :p |
| MigrationUser 1 Thursday, March 27, 2003 12:12 PM |
(slightly off-topic, but still of interest, methinks)
Re: aversion to using the Microsoft.VisualBasic library...
Was reading the guys from 3-Leaf blog awhile back, and they mentioned a similar issue with regard to <a href="http://radio.weblogs.com/0117167/2003/03/11.html">using IsNumeric from within C#</a>.
In Thomas Wagner's blog, he had <a href="http://radio.weblogs.com/0101986/2003/03/10.html#a923">mentioned</a> he was writing a C# implementation of IsNumeric; however, since the C# implementation was not _exactly_ the same as IsNumeric, the 3-Leaf guys (and a bunch of other folks) wondered why he (and other folks) weren't content to use:
if (Microsoft.VisualBasic.Information.IsNumeric("5")) { //Do Something }
Like I said, this is all from the 3-Leaf folks (I am just stealing, er...<i>cross-posting</i> it) - but I thought it was germane to the issue at hand.
Seth
|
| MigrationUser 1 Thursday, March 27, 2003 5:48 PM |
but what's your opinion on it, Seth? ;) |
| MigrationUser 1 Thursday, March 27, 2003 6:17 PM |
I find myself in front of rooms full of C# developers, saying things like "Get over yourselves" when someone gets all belligerent about not wanting to use the Microsoft.VisualBasic runtime assembly. Really stupid. Like it's going to somehow HURT the darned code. The Isnumeric function Thomas posted works, but really doesn't do exactly the same thing as the VB function. (Thomas and I go WAAAAAY back--funny to see him mentioned here out of the blue.)
Anway, I try not to use VB-only functionality if there's a choice. If not, I'm all for it! |
| MigrationUser 1 Thursday, March 27, 2003 7:02 PM |
>but what's your opinion on it, Seth?
Well, speaking just for myself (as opposed to some kind of "Official MSFT Propaganda"), were I writing an app right this minute that needed the functionality of IsNumeric, I would use Microsoft.VisualBasic.IsNumeric, not some kind of re-implementation.
|
| MigrationUser 1 Thursday, March 27, 2003 7:57 PM |
thanx...just checking ;)
don't worry, we won't take that as an official MSFT statement :) |
| MigrationUser 1 Thursday, March 27, 2003 8:01 PM |
Who's speaking again? A Microsoft rep?
Thanks for the help on this one guys! It works now. |
| MigrationUser 1 Friday, March 28, 2003 8:49 AM |
>Who's speaking again? A Microsoft rep?
"I'm not a Microsoft rep, but I play one on TV..." ;)
No - in acutality, I'm in on the Windows Forms User Education team - we try to act as advocates for our customers; our main task is to write the documentation (for Windows Forms) that ships with VS and the .NET Framework SDK.
To that end, if you folks have things that you love/hate about the docs, we always welcome input. The best place to contact us with questions and issues you have is at netfwsdk@microsoft.com. (Of course, posting to the Forums works fine, too!)
Thanks, S. |
| MigrationUser 1 Friday, March 28, 2003 12:36 PM |
I was just joking :-D !
Thanks for that info Seth! I am helping out the MS guys a lot with ASP.Net and would love to begin Windows Forms. |
| MigrationUser 1 Friday, April 04, 2003 10:40 AM |