Click here to Skip to main content
15,887,417 members
Home / Discussions / C#
   

C#

 
GeneralRe: Very strange "out of memory" exception Pin
softwarejaeger2-Sep-08 2:17
softwarejaeger2-Sep-08 2:17 
GeneralRe: Very strange "out of memory" exception Pin
leppie2-Sep-08 2:28
leppie2-Sep-08 2:28 
GeneralRe: Very strange "out of memory" exception Pin
softwarejaeger2-Sep-08 2:51
softwarejaeger2-Sep-08 2:51 
GeneralRe: Very strange "out of memory" exception Pin
Daniel Grunwald2-Sep-08 2:04
Daniel Grunwald2-Sep-08 2:04 
GeneralRe: Very strange "out of memory" exception Pin
softwarejaeger2-Sep-08 2:53
softwarejaeger2-Sep-08 2:53 
GeneralRe: Very strange "out of memory" exception Pin
Daniel Grunwald2-Sep-08 2:57
Daniel Grunwald2-Sep-08 2:57 
GeneralRe: Very strange "out of memory" exception Pin
softwarejaeger2-Sep-08 3:03
softwarejaeger2-Sep-08 3:03 
GeneralRe: Very strange "out of memory" exception Pin
Daniel Grunwald2-Sep-08 3:17
Daniel Grunwald2-Sep-08 3:17 
You have to do it manually. Whenever the user scrolls, dispose the controls going out of view and create new controls for the items coming into view.

Or, the alternative solution (IMHO better):
Use the Paint event of the control and draw using the e.Graphics object.

Something like this:
// in the table control:
protected override void OnPaint(PaintEventArgs e) {
  base.OnPaint(e);
  foreach (Cell c in cells) {
    c.Paint(e.Graphics, new Rectangle(...)); // tell the cell to draw itself
  }
}
// the cell:
class Cell { // no control!
  public void Paint(Graphics g, Rectangle r) {
    // drawing code
  }
}

You'll have to write the code to manage the cells and their drawing positions.
GeneralRe: Very strange "out of memory" exception Pin
softwarejaeger2-Sep-08 3:31
softwarejaeger2-Sep-08 3:31 
GeneralRe: Very strange "out of memory" exception Pin
softwarejaeger2-Sep-08 20:08
softwarejaeger2-Sep-08 20:08 
GeneralRe: Very strange "out of memory" exception Pin
softwarejaeger3-Sep-08 3:37
softwarejaeger3-Sep-08 3:37 
GeneralRe: Very strange "out of memory" exception Pin
Kythen2-Sep-08 12:01
Kythen2-Sep-08 12:01 
GeneralRe: Very strange "out of memory" exception Pin
leppie1-Sep-08 23:05
leppie1-Sep-08 23:05 
GeneralRe: Very strange "out of memory" exception Pin
Guffa1-Sep-08 23:25
Guffa1-Sep-08 23:25 
AnswerRe: Very strange "out of memory" exception Pin
tamour2-Sep-08 1:49
tamour2-Sep-08 1:49 
Questiondataset,dataadapter Pin
NiloofarNoroozi1-Sep-08 20:16
NiloofarNoroozi1-Sep-08 20:16 
AnswerRe: dataset,dataadapter Pin
AhsanS1-Sep-08 20:57
AhsanS1-Sep-08 20:57 
AnswerRe: dataset,dataadapter Pin
Muammar©1-Sep-08 22:55
Muammar©1-Sep-08 22:55 
AnswerRe: dataset,dataadapter Pin
Member 36367991-Sep-08 23:55
Member 36367991-Sep-08 23:55 
GeneralRe: dataset,dataadapter Pin
NiloofarNoroozi2-Sep-08 1:59
NiloofarNoroozi2-Sep-08 1:59 
QuestionXML Reading question. Pin
crash8931-Sep-08 19:30
crash8931-Sep-08 19:30 
AnswerRe: XML Reading question. Pin
AhsanS1-Sep-08 21:05
AhsanS1-Sep-08 21:05 
GeneralRe: XML Reading question. Pin
crash8932-Sep-08 6:42
crash8932-Sep-08 6:42 
AnswerRe: XML Reading question. Pin
PIEBALDconsult2-Sep-08 5:14
mvePIEBALDconsult2-Sep-08 5:14 
GeneralRe: XML Reading question. Pin
crash8932-Sep-08 6:48
crash8932-Sep-08 6:48 

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.