Click here to Skip to main content
12,819,913 members (30,674 online)
Click here to Skip to main content
Add your own
alternative version

Stats

78.4K views
385 downloads
38 bookmarked
Posted 12 Dec 2003

SheetView Control

, 12 Dec 2003
Rate this:
Please Sign up or sign in to vote.
A Microsoft Visual Interdev Tab Control

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

Share

About the Author

Mike Finnegan
Belgium Belgium
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralMy vote of 5 Pin
manoj kumar choubey26-Feb-12 22:22
membermanoj kumar choubey26-Feb-12 22:22 
GeneralUpdate Pin
q12345678916-Dec-03 3:25
memberq12345678916-Dec-03 3:25 
GeneralDraggable Tabs Pin
klenne15-Dec-03 2:38
memberklenne15-Dec-03 2:38 
GeneralRe: Draggable Tabs Pin
q12345678915-Dec-03 22:49
memberq12345678915-Dec-03 22:49 
GeneralRe: Draggable Tabs Pin
klenne9-Jan-05 3:54
memberklenne9-Jan-05 3:54 
GeneralSyntax Highlighting Textboxes Pin
jdunlap13-Dec-03 11:55
memberjdunlap13-Dec-03 11:55 
QuestionWhere's the sample image? Pin
Andrew Allen13-Dec-03 7:06
memberAndrew Allen13-Dec-03 7:06 
AnswerRe: Where's the sample image? Pin
q12345678913-Dec-03 23:29
memberq12345678913-Dec-03 23:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170308.1 | Last Updated 13 Dec 2003
Article Copyright 2003 by Mike Finnegan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid