|
Maybe, on the other side, there are already at least 5 data structures scatered on CodeProject, not mentionning other internet resources, so the material is already there.
Besides, I do not think the "upgrade" to generics will be too painfull. The most cool feature, from a colleciton implementaiton view, is the new way of defining iterators which will be much more easier.
Besides, creating the framework to test the fixture will not be lost with generics.
Jonathan de Halleux - www.dotnetwiki.org -
MbUnit - QuickGraph
|
|
|
|
|
I saw you mention this idea earlier today (well, I saw it earlier today) and think it's a neat idea, but let me suggestion something: it's ".NET", not ".Net" or ".net" (in which case the latter is reserved for use by Microsoft and only in logos). This is documented on Microsoft's site.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
don't hesitate to sneak in the project...
Heath Stewart wrote:
it's ".NET", not ".Net" or ".net"
Aaaargh, am I going to get sue for this!
Jonathan de Halleux - www.dotnetwiki.org -
MbUnit - QuickGraph
|
|
|
|
|
Jonathan de Halleux wrote:
Aaaargh, am I going to get sue for this!
No, not unless you trademark a product with ".NET" (or any variant) in it and make enough money for Microsoft to care about (and even then, they might not so long as you're supporting their cause, but IANAL).
Just thought since you're making a go of this and will probably want it to look nice/official/whatever, you might want to use proper casing.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
I have a project where I want to have the value in a listbox displayed in ToolTip rather than the default tooltip text whenever a MouseOver event occurs. However, when I created the eventhandler I was a bit surprised to see that it does not appear to return the coordinates of the mouse on the control.
I know it can be done -- even VS does it when hovering over a collapsed region. Any suggestions on how to deploy this?
I need to
a) determine either from sender or e which field is being hovered over, then
b) if it is blank area (default text) or populated area (display value of field)
_____________________________________________
Of all the senses I could possibly lose, It is the one called 'common' that gets lost the most.
|
|
|
|
|
You can always use the static Control.MousePosition property to get a Point in screen coordinates, which you can translate by passing that Point to the PointToClient method of the ListBox . Using that, you can find which item is under the cursor.
Unless you want to go to the trouble of encapsulating the ToolTip common control and all its messages and what-not, you could use the ToolTip component and call SetToolTip(yourListBox, "Your tooltip") , but I'm not sure exactly how that positions itself (I would assume it uses the coordinates of the current mouse position like it usually does). You can call that each time you want to change the text.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath. I figured out everything but the static MousePosition location. That got me rolling with all the fun mathematics!
Could have been great but the MouseHover event seems to never be getting raised.
On to investigate that bugger now.
_____________________________________________
Of all the senses I could possibly lose, It is the one called 'common' that gets lost the most.
|
|
|
|
|
Hello everybody!
Does anybody know how to get information about an assembly using the System.Reflection namespace?
I want to list all namespaces,classes,methods,......
Please help me
petermax2
|
|
|
|
|
Why don't you read MSDN ?
There's a lot of info and samples there.
Free your mind...
|
|
|
|
|
Hello
I have a Windows Service developed in C#. On startup it gets a Instance of a simple Gatewayobject. And make it available on the TCP port 13101.
On a WinXP Professional maschine there are no problems starting it but on win2k it only starts in 2 out of 10 times.
I have a WindowsForm app that do the same thing as the WindowsService and there are never a problem with that app on win2k or winXP.
What can be the problem?
|
|
|
|
|
Do you get any exceptions? Also try setting AutoLog to true and check the event logs for any errors that might have occured. Without knowing what the Gatewayobject is and what it attempts to do, I can't really offer you anything more than that.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I want to use mciSendCommand function in C# using Interop.
In that function the last parameter is a DWORD_PTR (ulong) that pointes to a structure that contains parameters for the specified command message.
What type shoud I use in that parameter when declaring the function in C#, and how can I convert a given struct/class to that type?
I'm declaring the structures like:
<br />
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]<br />
internal class MCI_OPEN_PARMS<br />
{<br />
public IntPtr dwCallback; <br />
public uint wDeviceID;<br />
...<br />
}
Thanks,
Pedro
|
|
|
|
|
DrGreen wrote:
DWORD_PTR (ulong)
DWORD_PTR equals UInt32 not UInt64.
top secret
|
|
|
|
|
Hi leppie,
Yes, I know that, my mistake...
What about the main question in my topic?
Do you know how to do that?
Thanks
|
|
|
|
|
Declare the field as an IntPtr and use the Marshal.StructureToPtr method to get the IntPtr value to assign to that field. If you expect changes to be saved to that structure, since it's a value type you must use Marshal.PtrToStructure when you get it back to get the new structure with the different values.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
is there a way i can add controls to a panel and make the panel resizable
chad
|
|
|
|
|
Of course you can add controls to your panel.
Example: this.control1.Parent = this.panel1;
(Control1's parent is set to panel1)
To resize your panel just set the Size property.
Example: this.panel1.Size = new Size([width],[heigth]);
or set the panel's Height and Width property.
Good luck!
|
|
|
|
|
will i be able to resize the panel at runtime
chad
|
|
|
|
|
Yes. That code he posted gets compiled and executed at runtime. You can change it's size and position all you want in response to events like mouse movement or clicks, etc.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
ok you must forgive me i'm new to csharp i changes the size of my panenl how do i make it where my users can change it when there useing my form because right now they can't change the size of it when i compile it
chad
|
|
|
|
|
Of course they can't change it unless you provide a way. It's compiled using a certain size and position. If you want the Panel to resize in relation to its container, look at the Anchor and Dock properties. With Anchor , if you anchor the control to opposite sides, it will be resized in relation the margin between its borders and that of the corresponding borders of the container control.
If you want your users to be able to resize it like you can in the designer, you'll have to provide a mechanism to do so, like handling the MouseDown to set a flag, the MouseMove event to resize or move the ocntrol if that flag is set, and the MouseUp event to reset the flag.
When you compile an application, it's runs according to how you program it. Application don't general allow for design-like changes to it. Part of the reason you compile an application is that people can't change it (easily).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hey
we ar working on a game project thats have a form in 1024x712, we will have one picture as a skin in the background, but we have notice that this will course alot of flickering when moving the form around, and if we have a picture box abouv it that got transparent corners it will flckering alot when its moves.
Is there any way to make this flickering to go away? it siems like the systemcontrollers grafik dont take much CPU but the big Form background takes alot ??
//Jimmy
|
|
|
|
|
You could enable double-buffering and paint it yourself in the OnPaint handler:
public class MyForm : Form
{
public MyForm()
{
SetStyle(ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);
}
protected override void OnPaint(PaintEventArgs e)
{
if (BackgroundImage != null)
e.Graphics.DrawImage(BackgroundImage, new Point(0, 0));
base.OnPaint(e);
}
} Something like that should do the trick.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hey thanks
I will loog in to this, but i dont realy understand what SetStyle is? maby there is som information about this in the MSDN =)
//Jimmy
|
|
|
|