OutlookBar
-
How can I create an outlook bar in C#, is it very complicate ? BTW i don't know if it's only a problem with my VS .NET version ( I Have full release) but the splitter control seems to have a bug, anybody can help me on this ?
Its going to be as complicated as creating it with any other toolkit :-P What is your problem with the splitter? James Simplicity Rules!
-
Its going to be as complicated as creating it with any other toolkit :-P What is your problem with the splitter? James Simplicity Rules!
-
But how can I create one Outlook Bar ? Splitter = why this control have to be docked somewhere to work ? in VC++ you can place it anywhere on the screen no ? Thanks J :)
Creating one is a bit different, but might not be too hard to do. Essentially each pane in the outlook bar consists of a Panel, a Button, and a List View set in Large Icon or Small Icon mode. Instead of a list view you can also create your own control which uses flat buttons instead. Clicking on a button tells the outer-most control that it needs to move the panels above to the top so only the button can be seen, and move the panels beneath the one selected to the bottom (changing the height of the panel so as not to obscure the other buttons). Then resize the panel that was clicked on so that it fills the rest of the area (DockStyle.Fill :)) Off the top of my head anyway :) If I get around to it I may actually write an Outlook Bar component someday :-D MFC differs a bit from .NET because it doesn't have any builtin layout engine. In .NET you get some aspects built in, which is why I think it requires docking. Usually though docking isn't a problem, you just have to figure out the combination of splitters and other controls to get it to look the way you want. James Simplicity Rules!
-
Creating one is a bit different, but might not be too hard to do. Essentially each pane in the outlook bar consists of a Panel, a Button, and a List View set in Large Icon or Small Icon mode. Instead of a list view you can also create your own control which uses flat buttons instead. Clicking on a button tells the outer-most control that it needs to move the panels above to the top so only the button can be seen, and move the panels beneath the one selected to the bottom (changing the height of the panel so as not to obscure the other buttons). Then resize the panel that was clicked on so that it fills the rest of the area (DockStyle.Fill :)) Off the top of my head anyway :) If I get around to it I may actually write an Outlook Bar component someday :-D MFC differs a bit from .NET because it doesn't have any builtin layout engine. In .NET you get some aspects built in, which is why I think it requires docking. Usually though docking isn't a problem, you just have to figure out the combination of splitters and other controls to get it to look the way you want. James Simplicity Rules!
k I think I got it. BTW I have another question :) how can I create a custom control on C#, I search over MSDN but I didn't got good result. The example in the .NET show us how create a user control make from existing control like a panel with 3 buttons and this will be a futur control I can use. But what I want to do it's to create a control by the beginning at the drawing stage or derived an existing one. Do you have good tutorials for this or reference anything which I can use to help me ?? Thanks Again James Jonathan
-
Creating one is a bit different, but might not be too hard to do. Essentially each pane in the outlook bar consists of a Panel, a Button, and a List View set in Large Icon or Small Icon mode. Instead of a list view you can also create your own control which uses flat buttons instead. Clicking on a button tells the outer-most control that it needs to move the panels above to the top so only the button can be seen, and move the panels beneath the one selected to the bottom (changing the height of the panel so as not to obscure the other buttons). Then resize the panel that was clicked on so that it fills the rest of the area (DockStyle.Fill :)) Off the top of my head anyway :) If I get around to it I may actually write an Outlook Bar component someday :-D MFC differs a bit from .NET because it doesn't have any builtin layout engine. In .NET you get some aspects built in, which is why I think it requires docking. Usually though docking isn't a problem, you just have to figure out the combination of splitters and other controls to get it to look the way you want. James Simplicity Rules!
I had a similar problem with a Toolbar - I did not want it locked so I put this in the Constructor after it initializes eg DockStyle.None . This is possible but you can forget about using the designer as it will not understand that the component is no longer docked and other coomponents eg a fill component will overwrite it so I had to use Dock to Bottom for the Fill Panel. Ben
-
k I think I got it. BTW I have another question :) how can I create a custom control on C#, I search over MSDN but I didn't got good result. The example in the .NET show us how create a user control make from existing control like a panel with 3 buttons and this will be a futur control I can use. But what I want to do it's to create a control by the beginning at the drawing stage or derived an existing one. Do you have good tutorials for this or reference anything which I can use to help me ?? Thanks Again James Jonathan
To create your own control simply create a new class and derive from System.Windows.Forms.Control; or in VS.NET choose to add a new item and choose Custom Control from the box. You can then handle the events you want (overriding OnPaint is going to be one of them :)) Here's a simple control that creates a very lightweight label
using System;
using System.Drawing;
using System.Windows.Forms;public class LightLabel : System.Windows.Forms.Control
{
public LightLabel() : base()
{
// Nothing to set here
}public override void OnPaint(PaintEventArgs e)
{
Brush textBrush = new SolidBrush(ForeColor);
Brush background = new SolidBrush(BackColor);Graphics g = e.Graphics; g.FillRectangle(background, Bounds); g.DrawString(Text, Font, textBrush, Bounds); textBrush.Dispose(); background.Dispose();
}
}I didn't actually compile the code but that is the general idea behind creating your own control. You'll also want to look at the ControlPaint class for lots of cool drawing effects you find on controls (the etched border, drawing a 'disabled' image, etc). If you want to get really fancy with your control you'll need to look at Designers which is something I haven't looked at in-depth yet. James Simplicity Rules!