Solved

Drawing on a TabControl?

Posted on 2006-06-15
1
1,183 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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 article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 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