Solved

Drawing on a TabControl?

Posted on 2006-06-15
1
1,185 Views
Last Modified: 2008-03-17
Hi

I did

protected override void OnPaint(PaintEventArgs pe)
        {            
            Graphics g = pe.Graphics;

g.DrawRectangle(penpieblack, x + 150, y, 20, 20);

In an old program and it worked fine.

Now I have a tabcontrol and three tabs within it.

Is there a special way to specify where to draw the data?
Ill only want it on one of the three pages in the tab control

Thanks
Boof
0
Comment
Question by:boofulls
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
Anandavally_P earned 20 total points
ID: 16910348
Try this:
First add a tab control with tabpages on it.
Add a PictureBox to one of the tab pages.

In the paint event of the PictureBox we can add the following code to draw a string.

 private void pictureBox1_Paint(object sender, PaintEventArgs e)
 {
      Graphics g = e.Graphics;
      g.DrawString("This is the new string drawn",new Font("Arial",10),Brushes.Blue,new
                            Point(30,30));
 }

Thanks
Anandavally P
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question