Click here to Skip to main content
15,906,296 members
Home / Discussions / C#
   

C#

 
GeneralRe: Detect cause of application memory leak Pin
Daniel Turini17-Oct-03 6:52
Daniel Turini17-Oct-03 6:52 
GeneralRe: Detect cause of application memory leak Pin
leppie17-Oct-03 9:46
leppie17-Oct-03 9:46 
GeneralRe: Detect cause of application memory leak Pin
Andy Davey17-Oct-03 11:08
Andy Davey17-Oct-03 11:08 
GeneralRe: Detect cause of application memory leak Pin
leppie17-Oct-03 11:49
leppie17-Oct-03 11:49 
GeneralRe: Detect cause of application memory leak Pin
Andy Davey17-Oct-03 12:00
Andy Davey17-Oct-03 12:00 
GeneralRe: Detect cause of application memory leak Pin
leppie17-Oct-03 12:16
leppie17-Oct-03 12:16 
GeneralUpdating my main form (gui) from another class Pin
eggie516-Oct-03 13:34
eggie516-Oct-03 13:34 
GeneralRe: Updating my main form (gui) from another class Pin
Andy Davey16-Oct-03 14:12
Andy Davey16-Oct-03 14:12 
eggie5 wrote:
Why can I not change the value of the progess bar to 100?

Do you mean that the progress bar doens't visually change or do you mean that the framework throws an exception.

Without seeing more of your code I would suspect its the former one. From what I can see you are expecting this pb class to update the progress bar in the applications main form. However, the pb class has no reference to the main form. When the pb class is created, a new object of type Form1 is created. This new is not the same object as the one displayed on the screen when you run your program. To get your guid member to reference the displayed form - pass a Form1 object reference to the pb constructor.

An example would be

public class Form1
{
  pb m_pb;

  public Form1()
  {
    m_pb = new pb(this);    
    //...
  }

  //...
}

public class pb
{
  Form1 guid;

  public pb(Form1 p_ref)
  {
    guid = p_ref;
    guid.progressBar1.Value = 100;
    //...
  }
  
  //...
}

GeneralRe: Updating my main form (gui) from another class Pin
eggie516-Oct-03 14:27
eggie516-Oct-03 14:27 
GeneralRe: Updating my main form (gui) from another class Pin
eggie516-Oct-03 14:41
eggie516-Oct-03 14:41 
GeneralRe: Updating my main form (gui) from another class Pin
Guillermo Rivero16-Oct-03 15:27
Guillermo Rivero16-Oct-03 15:27 
GeneralRe: Updating my main form (gui) from another class Pin
eggie516-Oct-03 15:44
eggie516-Oct-03 15:44 
GeneralRe: Updating my main form (gui) from another class Pin
Guillermo Rivero16-Oct-03 15:48
Guillermo Rivero16-Oct-03 15:48 
Generalunessecary reply Pin
eggie516-Oct-03 15:52
eggie516-Oct-03 15:52 
GeneralRe: unessecary reply Pin
Guillermo Rivero17-Oct-03 3:40
Guillermo Rivero17-Oct-03 3:40 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:46
eggie517-Oct-03 13:46 
GeneralRe: Updating my main form (gui) from another class Pin
ThunorMagi16-Oct-03 18:15
sussThunorMagi16-Oct-03 18:15 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 1:53
eggie517-Oct-03 1:53 
GeneralRe: Updating my main form (gui) from another class Pin
Bo Hunter17-Oct-03 11:32
Bo Hunter17-Oct-03 11:32 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 11:35
eggie517-Oct-03 11:35 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:49
eggie517-Oct-03 13:49 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:52
eggie517-Oct-03 13:52 
GeneralQuestion regarding DictionaryBase Collections class Pin
Subha Sundara16-Oct-03 11:40
Subha Sundara16-Oct-03 11:40 
GeneralRe: Question regarding DictionaryBase Collections class Pin
Jeff Varszegi16-Oct-03 12:01
professionalJeff Varszegi16-Oct-03 12:01 
GeneralGDI+ question Pin
16-Oct-03 6:22
suss16-Oct-03 6:22 

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.