Need an easy WinAPI grid in C - c

I am looking for a grid control that can be controlled via WinAPI messages. I have tried the BabyGrid from CodeGuru but it is very slow when it comes to displaying on large screen.
Anyone know of a good one?

ListView with Report style is not enough ?

Use any of the native Win32 grids controls. Ask on Adv. Win32 group for sample code (C/Win32)
Yes, there are several built-in Win32 Grid controls (documented, MS, and undocumented)
C code had also been posted on IRC
(and apparently a kid is playing by removing answers from Microsoft experts (Shell team)... pathetic)

Use any of the native Win32 grids controls.
Ask on Adv. Win32 group for sample code (C/Win32)

Related

Double-buffering *framework* in C and Windows GDI

Background: My client has a very extensive proprietary forms library which is effectively implemented in C (actually, it's a proprietary object-oriented language that basically wraps Windows controls and interacts with them with SendMessage(), SetStyle(), etc.)
Problem I want to solve: Whenever I drag/resize a top-level window (or drag a splitter) in an app implemented in the above framework, there is massive flicker. The top-level window is repainted, and any controls it contains repaint themselves.
Question 1: Is there a way to surgically introduce double-buffering into the forms library. In particular, I want to know if I can implement double-buffering using standard Windows GDI functions.
For example, if I could cause the top-level windows to be double-buffered such that all child windows of the top-level window are automatically drawn double-buffered as well. An even better alternative would be to be able to introduce double-buffering on any arbitrary window and have all its children inherit this.
The best solution would somehow cause the BeginPaint() function for child controls to return a handle to the DC of the offscreen back buffer so that I don't have to write special code for each individual control class.
Question 2: Is there a way (such as a set of flags) to cause generic Windows controls (EDIT, BUTTON, and so on) to draw themselves double-buffered? This would be a worse solution than a more generic approach that would just seamlessly give them the back buffer to draw on, but it might also be acceptable.
All help greatly appreciated. Please let me know if I can clarify anything for you.
Look into WS_EX_COMPOSITED, which is an extended window style that turns on double-buffering for the window. It may be enough to set this style on the parent of the controls.
You actually might be able to wrap all your window drawing code with C that executes C#, and that way there is already a double-buffered implementation for you.
How to eliminate flicker in Windows.Forms custom control when scrolling?

Silverlight - Highlight List<> of words/prhases within TextBox

I am new to Silverlight and have a requirement to highlight (or change font color) all words and phrases wtihin a TextBox that match a list of words/phrases. At first I though this would be easy, but the more I look into it, the more confused I get.
My goal is to write something reusable so I can also apply the logic to a RadGridView later. I've seen a few examples of stuff close to what I need, but it's beyond my Silverlight level at this point.
I want to write this myself to get a better understanding of how some of the Silverlight internals work. Can someone point me in the right direction of where to start on something like this? Should this be implemented in a control? Should I use a behavior? I'm using Silverlight 4.
Once I know where to start, I am sure I can get this done - with some help from you guys of course ;-)
Thanks,
-Scott
How about using the RadRichTextBox (I assume you have a licence for it as you mentionned the RadGridView)?
There's also a good sample project on Telerik forum that is doing exactly what you want to do.

WinForms "mini-windows"

I need to create some mini-windows, like the ones shown in the image bellow, in my winform main form.
It would be nice if they could be draggable, resizable, and, mainly, closable.
How can I approach this design? Has anybody already seen some control (with code available) implementing something similar?
alt text http://img716.imageshack.us/img716/5765/imagea.png
A normal Form works fine for this. Set its FormBorderStyle to either FixedToolWindow or SizableToolWindow as desired.
If you want to keep your floating windows inside your main window, use MDI (Multiple Document Interface). Here is a tutorial (Google can find you many more).
Have you tried just setting the FormBorderStyle property to SizeableToolWindow?
Is that what you're after?
You can create them as resizable and draggable custom controls.
You could use my example at:
http://hourlyapps.blogspot.com/2008/07/resizable-and-movable-controls-c-net.html

Building windows forms in C

So far, I've been able to create a window in C, and add a button and edit box to that window. But, where can I find an exhaustive list of the system classes for all the form controls? I can't remember where I found BUTTON and EDIT--is there a LABEL? LISTBOX? CHECKBOX? COMBOBOX? etc.
Then, how would I use those built in windows functions...I think they're called common controls? Like open a file, save as, print, etc.
You will go insane if you try to write raw Win32 code with C. If you can use C++, I highly suggest using Qt, if not, use Gtk.
Here you are: they are on MSDN.
But I agree with Zifre that you better use a gui-framework for stuff like this.
There are more like these, e.g. MFC or WTL.
Some people like things pure
stromcode zetcode forgers and heck if you're really feeling crazy, win32 in assembly
For the open dialogs and so on you want the Common Dialogs section -- http://msdn.microsoft.com/en-us/library/ms645524(VS.85).aspx.
Whilst on the subject of Win32, if you're using the file dialogs and therefore file names you may also find the shell functions (http://msdn.microsoft.com/en-us/library/bb776426(VS.85).aspx) handy -- in particular, the PathXXX ones. I wish I'd known about these when I was getting started.

WinForms TreeView

I am looking for a WinForms treeview control with following requirements:
Should be not so hard to write code for it (most tree/list combinations are way too complicated)
Should have some sort of easy drag and drop capabilities (including a vista-explorer style drop marker)
Should be free or at least affordable
Should provide some freedom of text/color/style/etc. of the treenodes (classic "outlook bold with blue numbers style)
Any ideas?
thx
i would recommend http://www.lidorsystems.com/ !
Another interesting alternative is TreeViewAdv, as suggested in another thread.
C# replacement for standard Treeview?
I'm a big fan of SandGrid by Divelements. I use it for all my ListViews and TreeViews. It even supports both at the same time (a TreeView with columns). I find it easy to use and very fast.
I think the standard WinForms' treeview control will do everything on your list. I don't know what the second item refers to as I've not used Vista. It's declared as System.Windows.Forms.TreeView and is available in VS200*'s form designer. I can't think of any simpler way of doing tree views.

Resources