|
|
Recently, I voiced my opinion (so what is new ) about my dislike for the underscore ("_") as a member prefix for private or protected members. Thought I would see what other think on this touchy subject. I personally find them very ugly and it makes the code harder to read. It makes member variable stand out worse than if they were in bold large type fonts.
Please take a quick moment to cast your vote below.
Vote[^]
Results[^]
Rocky <><
www.HintsAndTips.com
Me Blogs: wdevs - MSN Spaces (new)
|
|
|
|
|
How can i change text color of an item or subitem ?
Thanks!
|
|
|
|
|
See ListViewItem.ForeColor .
This space for rent!
My Blog
|
|
|
|
|
Hi,
I have a windows program with a menu that opens other Forms.
I've noticed that users will min. a Form and then later run another instance of the same Form from the menu. How do I make it so that instead of another Form opening, it just restores (displays) the Form already running in taskbar?
New to programming... thanks
|
|
|
|
|
Save your Form in a Field permanently. If it already exists you can restore it by setting the WindowState to normal and activating it as well.
WinForm.WindowState = FormWindowState.Normal;
WinForm.Activate();
|
|
|
|
|
Use the Singleton pattern. Create a static member variable in your form where you keep an instance of your form.
Add a static method to your form class called "GetInstance" (or whatever you like). In that method check to see if your static variable contains an instance of the form. If it doesn't, put one in there (using new).
Then return from GetInstance the form instance kept in your member variable.
This guarantees that as long as you always call "GetInstance" to get your form object (this will require discipline on your part) only one instance of a form will ever be created:
MyCustomForm myForm = MyCustomForm.GetInstance();
MyCustomForm myForm2 = MyCustomForm.GetInstance();
myForm.WindowState = Normal;
myForm.Activate();
This space for rent!
My Blog
|
|
|
|
|
What TypeCode does an int-Array have?
|
|
|
|
|
Here's my Problem:
I have a hashtable in which i save a TypeCode as the key and the fitting regular expression as the value.
So for System.TypeCode.Int32 it would be @"\-?\d".
But I also want to parse Numbers seperated by values . Therefore I need a TypeCode for integer/double-arrays or something like that
|
|
|
|
|
The typecode of an array is System.Typecode.Object .
This space for rent!
My Blog
|
|
|
|
|
|
HI,
I have looked at the api of the WM Format and Encoder 9.0. There is a good way to capture the whole monitor screen movements in the form of an avi file. I also read the example of Idael Cardoso about how do it.
But i have one extension to it. Basically i want to transfer the frames online. But here i cannot use the encoder broadcast mechanism. I have custom api for networking.
So my question being is there any way to capture the frames and send across the network thru Windows media format api or encoder api?
thanks
eligeti
|
|
|
|
|
I already opened a thread for that but I still don't have a clue how to simply get the X-Coordinates from the first connected Joystick.
Someone recommended me the Code on http://www.error-bank.com/microsoft.public.dotnet.languages.csharp/219796_Thread.aspx
but this Code is incomplete and I was not able to complete it yet. It's just to hard to understand it in order to complete the code.
|
|
|
|
|
Any Kind of help would be great.
|
|
|
|
|
Hi
I have some xml:
<code>
<build>
<usings>
<item>System.Threading</item>
<item>System.Drawing</item>
<item>System.Windows.Forms</item>
<item>System.Diagnostics</item>
<item>System.Microsoft.DirectX</item>
<item>D3D = Microsoft.DirectX.Direct3D</item>
</usings>
<references>
<item>System.dll</item>
<item>microsoft.directx.dll</item>
<item>microsoft.directx.direct3dx.dll</item>
<item>microsoft.directx.direct3dx.dll</item>
<item>system.data.dll</item>
<item>system.drawing.dll</item>
<item>system.windows.forms.dll</item>
<item>system.xml.dll</item>
</references>
</build>
</code>
How can I read that data from each of the items in the references?
This is some code I have at the moment:
<code>
XmlTextReader reader = null;
try
{
//Load the reader with the XML file.
reader = new XmlTextReader("test.xml");
//Parse the XML and display the text content of each of the elements.
while (reader.Read())
{
if (reader.IsStartElement())
{
if (reader.IsEmptyElement)
Console.WriteLine("<{0}/>", reader.Name);
else
{
Console.Write("<{0}> ", reader.Name);
reader.Read(); //Read the start tag.
if (reader.IsStartElement()) //Handle nested elements.
Console.Write("\r\n<{0}>", reader.Name);
Console.WriteLine(reader.ReadString()); //Read the text content of the element.
}
}
}
Console.ReadLine();
reader.ReadToDescendant("usings");
reader.
Console.WriteLine(reader.Name);
Console.ReadLine();
}
finally
{
if (reader != null)
reader.Close();
}
</code>
Thanks
|
|
|
|
|
I have developed a lot of c code and use c++ as the gui. So I down loaded Visual Studio 2005 beta version to find out a bit about c#. I was surprised that there is no windows.h file. Is this beause it is a beta version or is that the way it is with .NET?
|
|
|
|
|
You seem to have a wrong view on .Net and C#. C# has nothing to do with C or C++. But you can have managed C++ in the .Net world.
|
|
|
|
|
Is there no C in C#? I was hoping to use c# at the front end and C to do all the number crunching.
What will happen to my c/c++ code when I decide to move to .NET?
|
|
|
|
|
Have you read my post completely?
First of all there is managed C++ which is some kind of mix between C++ and the .Net world (never used it). You can also directly use C-dlls from C# (and from many of the other .Net languages too).
|
|
|
|
|
|
Thanks Dennis and Robert,
Will Visual Studio 2003.NET standard edition 'do' for me?
The 2005 beta edition does not have MFC in its templates window if I want to create a new project!
Thanks,
Mike
|
|
|
|
|
McSam wrote:
Will Visual Studio 2003.NET standard edition 'do' for me?
In terms of C/C++? I don't know. I primarily use C# and sometimes VB. Maybe you should ask that question on the Managed C++ board[^] (or the Visual C++ board[^] for that matter).
McSam wrote:
The 2005 beta edition does not have MFC in its templates window if I want to create a new project!
Please, don't get me wrong, but I'm a little bit confused why you insist on creating MFC applications with VS 2005. This product is mostly about .NET and you also haven't explained why you still have to create MFC applications. Maybe you should really give .NET a try and see if it works for you.
Best regards
Dennis
|
|
|
|
|
I am using VC++ V5.0, it is time to upgrade. .NET seems the only way to go? My projects so far do not involve the web or networks.
Regards,
Mike
|
|
|
|
|
McSam wrote:
I am using VC++ V5.0, it is time to upgrade. .NET seems the only way to go? My projects so far do not involve the web or networks.
No offense, but I think you're still missing the point what .NET is about. It has nothing to do with the web or networks in general. It's a technology which is in parts comparable to Java. Please have a look at MSDN .NET Framework Developer Center: Getting Started[^]. To further clarify it: MFC is a legacy technology from the .NET point of view.
Best regards
Dennis
|
|
|
|
|
rockmate wrote:
So I down loaded Visual Studio 2005 beta version to find out a bit about c#. I was surprised that there is no windows.h file.
I agree with Robert. C# is primarily about RAD with the .NET Framework and not about Win32 as long as there is a managed way to do it. There are no header files in C# anyway. I sometimes use the header files if I use P/Invokes and need some defines. Just download the Platform SDK[^] and remember that the Common Language Runtime (CLR)[^] defines its own data types (see Platform Invoke Data Types[^]).
Best regards
Dennis
|
|
|
|