Click here to Skip to main content
6,934,113 members and growing! (9,774 online)
Email Password   helpLost your password?
Desktop Development » Tabs & Property Pages » Tabs and Property Pages     Intermediate

SheetView Control

By Mike Finnegan

A Microsoft Visual Interdev Tab Control
C#, Windows, .NET1.0, .NET1.1, Visual-Studio, Dev
Posted:12 Dec 2003
Views:64,589
Bookmarked:31 times
printPrint Friendly   add Share
      Discuss Discuss   Broken Article?Report  
12 votes for this article.
Popularity: 3.10 Rating: 2.87 out of 5
2 votes, 16.7%
1
2 votes, 16.7%
2
3 votes, 25.0%
3
2 votes, 16.7%
4
3 votes, 25.0%
5

Sample screenshot

Introduction

The sample image shows what it is all about. I wanted to write a kind of osql.exe-with-a-GUI (osql is the command line utility which comes with the Microsoft MSDE database). I don't like the .NET tab controls: it's like they are a toolbar. So, I decided to write my own. It's a very simple control: there is no scrollbar to the right nor arrows to the left, to change the current selected tab.

The source code contains a demo project as well. SqlPad.cs shows you how to use the class SheetView.

Usage

... 
_SheetView = new SheetView();
_SheetView.Dock = DockStyle.Bottom;
_SheetView.Height = 18;
_SheetView.Font = new Font("verdana", 8, GraphicsUnit.Point);
_SheetView.Sheets.Add(new Sheet("Output 1"));
_SheetView.Sheets.Add(new Sheet("Output 2"));
_SheetView.OnSelectionChanged += new EventHandler(OnOutputWindowChanged); 
... 
void OnOutputWindowChanged(Object sender, EventArgs e)
{
    _Output[0].Visible = false;
    _Output[1].Visible = false;
    _Output[_SheetView.SelectedIndex].Visible = true;
}

Note 1: SqlPad also shows you how to handle the typical File New, Open, Save and Save As menu items. Take a look at Document.cs and SqlDocument.cs. However, Document needs a little polishing if you want to use it in your own projects: for example, there're no property filters. The project also shows how to deal with the Undo Bug in RichTextBox: examine RichTextBoxBase.cs if you're interested.

Note 2: SqlPad isn't finished at all. I thought it would be easy to create a syntax color text box based on RichTextBox, but it isn't. I would have to write my own editor from scratch, but on my computer, it seems that it would be better to implement one in C, .NET is too slow.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Mike Finnegan


Member

Location: Belgium Belgium

Other popular Tabs & Property Pages articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 7 of 7 (Total in Forum: 7) (Refresh)FirstPrevNext
GeneralUpdate Pinmemberq1234567893:25 16 Dec '03  
GeneralDraggable Tabs Pinmemberklenne2:38 15 Dec '03  
GeneralRe: Draggable Tabs Pinmemberq12345678922:49 15 Dec '03  
GeneralRe: Draggable Tabs Pinmemberklenne3:54 9 Jan '05  
GeneralSyntax Highlighting Textboxes Pinmemberjdunlap11:55 13 Dec '03  
GeneralWhere's the sample image? PinmemberAndrew Allen7:06 13 Dec '03  
GeneralRe: Where's the sample image? Pinmemberq12345678923:29 13 Dec '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+PgUp/PgDown to switch pages.

PermaLink | Privacy | Terms of Use
Last Updated: 12 Dec 2003
Editor: Nishant Sivakumar
Copyright 2003 by Mike Finnegan
Everything else Copyright © CodeProject, 1999-2010
Web18 | Advertise on the Code Project