Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
QuestionMemory Allocation For new Object Pin
friend4allmo6-Jun-06 16:54
friend4allmo6-Jun-06 16:54 
AnswerRe: Memory Allocation For new Object Pin
Guffa6-Jun-06 18:52
Guffa6-Jun-06 18:52 
GeneralRe: Memory Allocation For new Object Pin
leppie6-Jun-06 21:00
leppie6-Jun-06 21:00 
AnswerRe: Memory Allocation For new Object Pin
friend4allmo7-Jun-06 8:44
friend4allmo7-Jun-06 8:44 
QuestionHow to define a function from WIN32 DLL in c# . Pin
dfbx6-Jun-06 16:20
dfbx6-Jun-06 16:20 
AnswerRe: How to define a function from WIN32 DLL in c# . Pin
dr.TyGER (Konstantin)6-Jun-06 18:57
dr.TyGER (Konstantin)6-Jun-06 18:57 
GeneralRe: How to define a function from WIN32 DLL in c# . Pin
dfbx6-Jun-06 19:21
dfbx6-Jun-06 19:21 
QuestionDisplay of text delayed [modified] Pin
printscreen123456-Jun-06 15:53
printscreen123456-Jun-06 15:53 
I have a treeview which lists all the chapters of a book. Whenever the treeView is selected, the program is supposed to paint the text of the entire chapter onto a tabpage.

*******************************************************************************
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
// a query is run here to produce a result of text from a certain chapter and then import it to a chap_lines string array
tabPage1.Paint += new PaintEventHandler(tabPage1_Paint);
}

private void tabPage1_Paint(object sender, PaintEventArgs e)
{
y = 8;
Graphics g = e.Graphics;

foreach (string line in chap_lines)
{
g.DrawString(line, new Font("Courier New", 10, System.Drawing.FontStyle.Regular), new SolidBrush(Color.Black), 3, y);
y = y+20;
}

}
*******************************************************************************

The problem is that the text is not painted until the next chapter node is selected. Chapter 1 is okay as it is the default node. But if I then select chapter 3, those text of chapter 1 stay there. The text of chapter 3 is not displayed until another chapter is selected.

The thing is when I debug the program setting the breakpoint at "tabPage1.Paint += new PaintEventHandler(tabPage1_Paint)", it gives me the correct result. But if I set the breakpoint anywhere in the tabPage1_Paint event, it can never get out of itself. Why is that?

How can I display its correct text once a chapter is selected?

Also, I have set the tabPage1.AutoScroll to true but it still doesn't scroll to display those lines that are not visible to the tabPage1 area.

-- modified at 22:07 Tuesday 6th June, 2006
AnswerRe: Display of text delayed [modified] Pin
Guffa6-Jun-06 19:00
Guffa6-Jun-06 19:00 
GeneralRe: Display of text delayed [modified] Pin
printscreen123456-Jun-06 19:33
printscreen123456-Jun-06 19:33 
AnswerRe: Display of text delayed [modified] Pin
Guffa6-Jun-06 23:15
Guffa6-Jun-06 23:15 
GeneralRe: Display of text delayed [modified] Pin
printscreen123457-Jun-06 1:37
printscreen123457-Jun-06 1:37 
GeneralRe: Display of text delayed [modified] Pin
Guffa7-Jun-06 20:23
Guffa7-Jun-06 20:23 
GeneralRe: Display of text delayed Pin
printscreen123459-Jun-06 21:30
printscreen123459-Jun-06 21:30 
AnswerRe: Display of text delayed Pin
Guffa9-Jun-06 22:22
Guffa9-Jun-06 22:22 
GeneralRe: Display of text delayed Pin
printscreen1234510-Jun-06 1:23
printscreen1234510-Jun-06 1:23 
QuestionData binding Pin
liquid_6-Jun-06 11:28
liquid_6-Jun-06 11:28 
QuestionDatagridview and checkbox column Pin
perryf006-Jun-06 10:48
perryf006-Jun-06 10:48 
AnswerRe: Datagridview and checkbox column Pin
Mairaaj Khan6-Jun-06 22:15
professionalMairaaj Khan6-Jun-06 22:15 
QuestionColumn Width Pin
gregbushman6-Jun-06 8:18
gregbushman6-Jun-06 8:18 
GeneralRe: Column Width Pin
Guffa6-Jun-06 8:44
Guffa6-Jun-06 8:44 
AnswerRe: Column Width Pin
yodern6-Jun-06 23:32
yodern6-Jun-06 23:32 
QuestionNeed help in messenger Pin
Musharaf Zaheer6-Jun-06 7:50
Musharaf Zaheer6-Jun-06 7:50 
GeneralRe: Need help in messenger Pin
Guffa6-Jun-06 11:15
Guffa6-Jun-06 11:15 
QuestionCheck the internet connection status Pin
ventomito6-Jun-06 7:31
ventomito6-Jun-06 7:31 

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.