|
How
most types such as int have a Parse method but Guid does not.
currently I do this
<br />
static public Guid Parse(string input)<br />
{<br />
Guid guid = new Guid();<br />
guid = (Guid)TypeDescriptor.GetConverter(guid).ConvertFromString(input);<br />
return guid;<br />
}<br />
but it seems very long winded.
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
Won't this work for you?
<br />
Guid g = new Guid(input);<br />
|
|
|
|
|
doh! - I never noticed that Guid took a string as a constuctor argument - I did think it was daft what I had to do and knew I was missing something
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
how can I make new line in label?
I want that a label will be with number unknwon of lines and i want it ot be handled in run time.
i want that a string will be created in run time and than to do : label.text = string
how can i do it??
thank u.
sharon
|
|
|
|
|
I don't have the VS.NET on this computer right now but I think you have to set the label control to have multiply lines...
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
.Multiline = true;
MSDN doc.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site. Support for development will ship at the same time as the Windows XP Service Pack 1 (SP1) release.
|
|
|
|
|
No multiline property for a label. I think your ref is for a text box. Did you try putting a newline in the string to see what happens?
label.Text = "Text" + Environment.NewLine + "More Text";
Not sure if that will work.
Bill F
|
|
|
|
|
Hi,
Can someone please tell me how to make a dynamic array in C# or similar data storage type, like VB List? Thanks!![Laugh | :laugh:](https://www.codeproject.com/script/Forums/Images/smiley_laugh.gif)
|
|
|
|
|
with the object- ArrayList - you have to add :
using Sustem.Collection;
|
|
|
|
|
hi,
i'm developing a program with a transparent area. i want to draw a text on that area. how do i get to know the colors of the pixels underneath? i want to adjust the textcolor, so that the text is almost always easy to read (you know, white on black, black on white, etc...)
would be the same, if i would like to develop a screenshot-program.
any idea?
thx.
:wq
|
|
|
|
|
I think you'll have to use P/Invoke to call directly into the Win32 API to do this.
Here's a class I wrote that should get you started; it does screenshots now.
http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=win32window
One more thought - GDI+ supports alpha channel blending, which lets you do transparency. I don't know if it works for windows over the desktop, but it's worth exploring. You'll find it in the System.Drawing namespace.
|
|
|
|
|
i will look at your class in a minute. thx.
i know about the alpha-blending and i'm using it. that's why i need the background-pixels. i want to know which color to use for text in the transparent area. when the background is dark, i use a light color, when it is red i use ... you see?
:wq
|
|
|
|
|
yep. it works. great man!
so GetDesktopWindow is the magic function. hmm. i always thought it takes a picture of the background-image of the desktop...but luckily i was wrong and it really takes a screenshot
btw: what das msft mean?
:wq
|
|
|
|
|
Rüpel wrote:
what does msft mean?
Microsoft, if I remember correctly Eric is one of the higher ups of the C# team.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Hello everybody !
I want to use the WindowsXP FaxService COM API in my solution. I`m using Visual Studio .NET
I added a reference to the FaxService TypeLibrary in the project and the generated NameSpace is FAXCOMEXLib.
Then I wrote the following code:
try<br />
{<br />
FAXCOMEXLib.FaxServerClass FaxServer=new FAXCOMEXLib.FaxServerClass();
FaxServer.Connect("");
<br />
FAXCOMEXLib.FaxFolders FaxFolders=FaxServer.Folders;
<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
After creating the FaxServer object and connecting it to the local FaxService, the Properties that return an object (like Folders,InboundRouting,LoggingOptions) are not valid.
There is a {System.InvalidCastException} in the Value of the Autos section in the debugger. Why?
Thank you !
|
|
|
|
|
Hmmm? Something completely dedicated to C#/.NET/ASP.NET? Tired of hearing people battle languages or all the things Microsoft did wrong, just a good regularly updated source of information C#.
Rocky Moore
|
|
|
|
|
MSDN is a pretty good mag - I just resubscribed myself.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
If I I didn't lived in sweden and lived in US instead I would subscribe to that magazine!
It's too expensive to import to sweden!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Christian Graus wrote:
MSDN is a pretty good mag - I just resubscribed myself.
Yeah, it is pretty good for articles and is one of the most worn The only other one I read with any regularity is Visual Studio magazine but it is falling quickly. They keep pushing VB.NET. I guess most of their readers must be VB'ers but I don't care to ever read an article written in VB, I left the DIM statement over 20 years ago and don't care to go back
It surprises me that some company has not jumped on it yet. With .NET/C# the possibilities of coding have increased in such leaps that it put the fun back in programming. That is not to mention how you have to wrap you mind around a completely new programming model. Reminds me of when I jumped from C programming in DOS to C++ and Windows 3.0, totally different worlds.
I would love to find a magazine or eZine that similar to the old Compute! Magazine or even Byte for that matter just all consumed in .NET and C#. You know articles that help you code not argue compatibilities and capabilities. I am already sold on C#, no turning, I just want exciting articles on coding and best practices of coding in this new world.. There seems to be a large number of programmers involved in C#/.NET, well maybe the media will pick up more on it.
Just take a look here at CP. The C# forum runs usually 15%-40% of the volume of the C++ forum which CP has mostly been a C++ site. It’s catching on…
[stepping down from soapbox]
Thanks for the suggestion.
Rocky Moore
|
|
|
|
|
Visual Studio mag WAS VB Developer mag, they merged with their failed C++ mag, which failed because it moved entirely to C# without changing the name. I gave up on it long ago.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
Visual Studio mag WAS VB Developer mag, they merged with their failed C++ mag, which failed because it moved entirely to C# without changing the name. I gave up on it long ago.
And now Visual Studio Magazine is completely failing.. Have you noticed how thin they are I personally would be willing to pay a subscription to a decent magazine on the topic with an organized advertising section (I still like looking at the ads).
Rocky Moore
|
|
|
|
|
Hi,
My application will collect different parameters from user input. Once the "Execute" button is pressed, the parameters will be passed to related methods for exection. I try to figure out how to stop the program flow (not close the application but ask input for missing parameters)if I find some parameters missing (something like Exit() in VB) Can someone please tell me how to do this? Thanks!!
|
|
|
|
|
|
Thank you. Since I am new to C#, can you please show me how to throw an exception and catch it? Thanks!
|
|
|
|
|