How can I read individual frames from an animated image?
GDI+ has direct support for reading and outputting animated images. To get at the individual frames, you can use the image’s FrameDimensionList, and then call SelectActiveFrame, by passing in the dimension and the zero based frame index. First, create a new FrameDimension object: FrameDimension dimension = new System.Drawing.Imaging.FrameDimension(myImage.FrameDimensionsList[0]); Once you have the dimension, you can get the frame count: int frameCount = myImage.GetFrameCount(dimension); Now, that you know the frame count of the image, you can call SelectActiveFrame by passing in the dimension and the frame index (zero based). myImage.SelectActiveFrame(dimension,1); If the image is being viewed at runtime, then the call to SelectActiveFrame will set the current frame, and then begin to loop through again (unless it is a jpeg image). The attached sample works around this by saving the image to a MemoryStream for display – thereby capturing the one frame that is chosen. Sample Application w/Source Code C# or VB
How can I display a form that is ‘TopMost’ for only my application, but not other applications
You can do this by setting the child form’s TopMost to False and setting its Owner property to the MainForm. [C#] Form1 f = new Form1(); f.TopMost = false; f.Owner = this; f.Show(); [VB.NET] dim f as New Form1() f.TopMost = False f.Owner = Me f.Show()
How can I change the font used in a grid cell on a cell by cell or row by row basis
One way to do this is to use a derived columnstyle, override the Paint method and do the text drawing yourself, using whatever font or colors you like. If you add an event to your derived column style that is fired immediately before the text is drawn, and use the event args to get the font and color information, you can let the event handler completely determine the look of any cell. The attached samples (C#, VB) use this technique to create a grid that looks like the grid in the picture. Both color and font varies on a cell basis or row basis in this picture.
Can I play audio and video files using .NET
You cannot directly do this using .NET. However, there are some wrapper classes available at http://www.mentalis.org/soft/class.qpx?id=1 that allow you to do just this. You can download the latest version of these classes directly from the site. We have packaged these classes as a library and added a simple Winforms sample and made these available here. This library basically uses the Media Control Interface (MCI).
How do I catch a doubleclick in my datagrid
The problem is that the first click of a double click may be caught by the datagrid (and used to activate the cell) while the second click goes to the TextBox for the columnstyle object. This means the TextBox thinks this is a singleclick, and does not fire its doubleclick event. One solution is to mark the time of the click caught by the datagrid. Then look at this time in the TextBox’s mousedown handler to see if in fact the single click being looked at by the TextBox is part of a double click. You can download a sample (C#, VB) that illustrates how this might be done.