Click here to Skip to main content
16,005,734 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to conjoin C# code with VC++6.0 code? Pin
Heath Stewart6-Oct-04 19:50
protectorHeath Stewart6-Oct-04 19:50 
GeneralThanks! Pin
momer7-Oct-04 15:31
momer7-Oct-04 15:31 
Questionhow to stream video files via web application(asp.net) Pin
walpork6-Oct-04 18:57
walpork6-Oct-04 18:57 
AnswerRe: how to stream video files via web application(asp.net) Pin
Heath Stewart6-Oct-04 19:48
protectorHeath Stewart6-Oct-04 19:48 
Generalmy drawing disappear Pin
xiaowenjie6-Oct-04 17:14
xiaowenjie6-Oct-04 17:14 
GeneralRe: my drawing disappear Pin
Heath Stewart6-Oct-04 19:47
protectorHeath Stewart6-Oct-04 19:47 
GeneralRe: my drawing disappear Pin
xiaowenjie7-Oct-04 3:47
xiaowenjie7-Oct-04 3:47 
GeneralRe: my drawing disappear Pin
Heath Stewart7-Oct-04 7:28
protectorHeath Stewart7-Oct-04 7:28 
Firs tof all, MessageBox.Show is the worst way to debug an application. Set a breakpoint on the line you want and in Visual Studio hit F5 while doing a debug build. That's real debugging and can yield far more valuable data than MessageBox.Show.

Define drawGraph like so (and please following .NET naming guideilnes when developing, which is documented in the .NET Framework SDK):
static readonly Pen BlackPen = new Pen(Color.Black, 1);
private void DrawGraph(Graphics g)
{
  // ...
}
 
protected override void OnPaint(PaintEventArgs e)
{
  base.OnPaint(e);
  if (graphEnabled) DrawGraph(e.Graphics);
}
 
private void button1_Click(object sender, EventArgs e)
{
  graphEnabled = true;
  Refresh();
}
I'm assuming here that button1 works as an enabler. When you call Refresh the client area is invalidated and redrawn immediately, meaning that OnPaint gets called. As long as graphEnabled is true in this example, any invalidated of your control (i.e., when a portion is hidden) will be redrawn with the graph.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
GeneralRe: my drawing disappear Pin
xiaowenjie20-Oct-04 20:14
xiaowenjie20-Oct-04 20:14 
GeneralRe: my drawing disappear Pin
Heath Stewart20-Oct-04 21:46
protectorHeath Stewart20-Oct-04 21:46 
GeneralAccessing an object created by another class Pin
NietzscheDisciple6-Oct-04 15:59
NietzscheDisciple6-Oct-04 15:59 
GeneralRe: Accessing an object created by another class Pin
Christian Graus6-Oct-04 16:27
protectorChristian Graus6-Oct-04 16:27 
GeneralRe: Accessing an object created by another class Pin
NietzscheDisciple6-Oct-04 17:21
NietzscheDisciple6-Oct-04 17:21 
GeneralRe: Accessing an object created by another class Pin
Tom Clement6-Oct-04 17:59
professionalTom Clement6-Oct-04 17:59 
GeneralRe: Accessing an object created by another class Pin
NietzscheDisciple6-Oct-04 18:14
NietzscheDisciple6-Oct-04 18:14 
GeneralRe: Accessing an object created by another class Pin
NietzscheDisciple6-Oct-04 18:42
NietzscheDisciple6-Oct-04 18:42 
GeneralRe: Accessing an object created by another class Pin
Tom Clement6-Oct-04 19:07
professionalTom Clement6-Oct-04 19:07 
GeneralControls related question Pin
NietzscheDisciple6-Oct-04 15:08
NietzscheDisciple6-Oct-04 15:08 
GeneralRe: Controls related question Pin
Christian Wikander6-Oct-04 21:12
Christian Wikander6-Oct-04 21:12 
GeneralPasswordAge from LDAP Pin
Andy *M*6-Oct-04 12:11
Andy *M*6-Oct-04 12:11 
GeneralRe: PasswordAge from LDAP Pin
Heath Stewart6-Oct-04 19:44
protectorHeath Stewart6-Oct-04 19:44 
GeneralRe: PasswordAge from LDAP Pin
Andy *M*6-Oct-04 23:38
Andy *M*6-Oct-04 23:38 
GeneralRe: PasswordAge from LDAP Pin
Heath Stewart7-Oct-04 7:10
protectorHeath Stewart7-Oct-04 7:10 
Generalcustom property Pin
Grammel6-Oct-04 11:20
Grammel6-Oct-04 11:20 
GeneralRe: custom property Pin
Heath Stewart6-Oct-04 12:33
protectorHeath Stewart6-Oct-04 12:33 

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.