Solved

Drawing on a TabControl?

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now