Click here to Skip to main content
16,017,899 members
Home / Discussions / C#
   

C#

 
QuestionUsing resource Pin
alexia_teh23-Oct-07 0:03
alexia_teh23-Oct-07 0:03 
AnswerRe: Using resource Pin
kenprog23-Oct-07 15:15
kenprog23-Oct-07 15:15 
QuestionDynamic Textbox controll Pin
pashitech23-Oct-07 0:01
pashitech23-Oct-07 0:01 
AnswerRe: Dynamic Textbox controll Pin
sujithkumarsl23-Oct-07 1:58
sujithkumarsl23-Oct-07 1:58 
QuestionPanel scrolling Pin
blackjack215022-Oct-07 23:58
blackjack215022-Oct-07 23:58 
AnswerRe: Panel scrolling Pin
Harini N K23-Oct-07 0:05
Harini N K23-Oct-07 0:05 
GeneralRe: Panel scrolling Pin
blackjack215023-Oct-07 0:40
blackjack215023-Oct-07 0:40 
GeneralRe: Panel scrolling Pin
Ajay.k_Singh23-Oct-07 1:58
Ajay.k_Singh23-Oct-07 1:58 
Put a picture box control in a panel and set its SizeMode property to AutoSize and then set AutoScroll property of Panel to True.

Now draw your chart on Picture box instead of Panel.

However the most important point is that, in this scenario you will need to reset the width of Picture box according to the increasing size of Graph. Therefore you will have to measure the width of the drawn area and reset width of Picture Box.

Following is a small code snippet which I used to test, it draws a long string on a Picturebox and Panel will show scroll bar as expected.-

------------------Code Start------------------------------------------------------

private void PictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)

{

Graphics g = e.Graphics;

string str = "JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmJJJJJJJJJJJ";

g.DrawString(str, new Font("Arial", 14, FontStyle.Bold, GraphicsUnit.Pixel), Brushes.Black, 50, 50);

this.PictureBox1.Width = g.MeasureString(str, new Font("Arial", 14, FontStyle.Bold, GraphicsUnit.Pixel)).Width + 4;

}
-------------Code End--------------------------------------

I hope this will help you in finding the exact resolution.

-Dave.



Dave Traister,
ComponentOne LLC.
www.componentone.com

GeneralRe: Panel scrolling Pin
blackjack215023-Oct-07 5:16
blackjack215023-Oct-07 5:16 
QuestionRunning Multiple ex's using single object of Process Class Pin
Neeraj Kr22-Oct-07 23:53
Neeraj Kr22-Oct-07 23:53 
QuestionThe case of the disappearing combo box Pin
jozsurf22-Oct-07 23:49
jozsurf22-Oct-07 23:49 
QuestionHow to initialize a nullable array object at runtime? Pin
Spunky Coder22-Oct-07 23:18
Spunky Coder22-Oct-07 23:18 
AnswerRe: How to initialize a nullable array object at runtime? Pin
DavidNohejl22-Oct-07 23:23
DavidNohejl22-Oct-07 23:23 
GeneralRe: How to initialize a nullable array object at runtime? Pin
Spunky Coder22-Oct-07 23:39
Spunky Coder22-Oct-07 23:39 
AnswerRe: Regular Expression in String.Replace() method. Pin
william.zheng22-Oct-07 23:07
william.zheng22-Oct-07 23:07 
GeneralRe: Regular Expression in String.Replace() method. Pin
J4amieC22-Oct-07 23:31
J4amieC22-Oct-07 23:31 
JokeRe: Regular Expression in String.Replace() method. Pin
Guffa22-Oct-07 23:40
Guffa22-Oct-07 23:40 
QuestionHow to validate current object in databinding before move to another Pin
El'Cachubrey22-Oct-07 22:02
El'Cachubrey22-Oct-07 22:02 
QuestionInsert command Pin
sindhutiwari22-Oct-07 21:38
sindhutiwari22-Oct-07 21:38 
AnswerRe: Insert command Pin
pmarfleet22-Oct-07 22:28
pmarfleet22-Oct-07 22:28 
GeneralRe: Insert command Pin
sindhutiwari22-Oct-07 22:35
sindhutiwari22-Oct-07 22:35 
QuestionRegular Expression in String.Replace() method. Pin
248912822-Oct-07 21:29
248912822-Oct-07 21:29 
AnswerRe: Regular Expression in String.Replace() method. Pin
Pawel Gielmuda22-Oct-07 22:34
Pawel Gielmuda22-Oct-07 22:34 
AnswerRe: Regular Expression in String.Replace() method. Pin
Guffa22-Oct-07 22:54
Guffa22-Oct-07 22:54 
QuestionCopy Identity column data Pin
Rabab Siblini22-Oct-07 21:15
Rabab Siblini22-Oct-07 21:15 

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.