Click here to Skip to main content
16,015,414 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem regarding accessing mail server using C# Pin
_AK_18-May-06 19:13
_AK_18-May-06 19:13 
GeneralRe: problem regarding accessing mail server using C# Pin
nikeshkumar18-May-06 19:23
nikeshkumar18-May-06 19:23 
AnswerRe: problem regarding accessing mail server using C# Pin
_AK_18-May-06 19:32
_AK_18-May-06 19:32 
GeneralRe: problem regarding accessing mail server using C# Pin
coolestCoder18-May-06 19:59
coolestCoder18-May-06 19:59 
GeneralRe: problem regarding accessing mail server using C# Pin
nikeshkumar18-May-06 20:19
nikeshkumar18-May-06 20:19 
GeneralRe: problem regarding accessing mail server using C# Pin
nikeshkumar18-May-06 21:13
nikeshkumar18-May-06 21:13 
GeneralRe: problem regarding accessing mail server using C# Pin
_AK_19-May-06 0:44
_AK_19-May-06 0:44 
QuestionHow to display a page of text on a tabpage? Pin
printscreen1234518-May-06 18:11
printscreen1234518-May-06 18:11 
Hi,

I want to display some text on a tabpage given that some of the text is linkable. How do I do this?

I tried using both label and linklabel to display them, but the thing is that I don't get any of these label/linklabel text displayed at all except the last linklabel text. What have I done wrong?

int lab_tab_idx = 0;
int linklab_tab_idx = 0;
int y = 0;

foreach (DataRow dr in text.Rows)
{
string text = Convert.ToString(dr[1]);
/* e.g. {hyperlink FANTASTIC PHONICS} is based on national research
which shows that the best outcomes are achieved with
{hyperlink SYSTEMATIC} instruction, using {hyperlink GUIDED
READERS} which are sequential and gently graded. */

string[] newtext = text.Split('{', '}');
int i = 0;
int x = 3;

System.Windows.Forms.Label label = new System.Windows.Forms.Label();
LinkLabel linklabel = new LinkLabel();

while (i < newtext.Length)
{
string tmp = newtext[i];
if (tmp.StartsWith("hyperlink "))
{
tabPage1.Controls.Add(linklabel);
linklabel.AutoSize = true;
linklabel.Location = new System.Drawing.Point(x, y);
linklabel.Name = "linklabel" + linklab_tab_idx;
linklabel.TabIndex = linklab_tab_idx;
linklabel.TabStop = true;
linklabel.Text = tmp.Replace("hyperlink ", "");
x = x + linklabel.Text.Length * 6;
linklab_tab_idx++;
}
else
{
tabPage1.Controls.Add(label);
label.AutoSize = true;
label.Location = new System.Drawing.Point(x, y);
label.Name = "label" + lab_tab_idx;
label.TabIndex = lab_tab_idx;
label.TabStop = true;
label.Text = tmp;
x = x + label.Text.Length * 6;
lab_tab_idx++;
}
i++;
}
y = y + 20;
}

Also, how do I calculate the location of the next label as the text string is dynamic?

Thanks


printscreen12345
AnswerRe: How to display a page of text on a tabpage? Pin
Robert Rohde18-May-06 18:49
Robert Rohde18-May-06 18:49 
GeneralRe: How to display a page of text on a tabpage? Pin
printscreen1234518-May-06 19:05
printscreen1234518-May-06 19:05 
GeneralRe: How to display a page of text on a tabpage? Pin
Robert Rohde18-May-06 20:29
Robert Rohde18-May-06 20:29 
GeneralRe: How to display a page of text on a tabpage? Pin
printscreen1234518-May-06 21:13
printscreen1234518-May-06 21:13 
GeneralRe: How to display a page of text on a tabpage? Pin
Robert Rohde18-May-06 21:43
Robert Rohde18-May-06 21:43 
GeneralRe: How to display a page of text on a tabpage? Pin
printscreen1234519-May-06 1:38
printscreen1234519-May-06 1:38 
GeneralRe: How to display a page of text on a tabpage? Pin
Robert Rohde19-May-06 4:35
Robert Rohde19-May-06 4:35 
AnswerRe: How to display a page of text on a tabpage? Pin
Stefan Troschuetz18-May-06 21:16
Stefan Troschuetz18-May-06 21:16 
QuestionHow I can receive text message of yahoo messenger in C#? Pin
WindOpen18-May-06 18:07
WindOpen18-May-06 18:07 
QuestionRegistration code generator Pin
JacquesDP18-May-06 18:00
JacquesDP18-May-06 18:00 
QuestionHow to make DataGrid (Right to left) Pin
alokabasha18-May-06 17:19
alokabasha18-May-06 17:19 
AnswerRe: How to make DataGrid (Right to left) Pin
led mike18-May-06 18:15
led mike18-May-06 18:15 
GeneralRe: How to make DataGrid (Right to left) Pin
alokabasha20-May-06 5:45
alokabasha20-May-06 5:45 
QuestionC# 2.0 TreeView and ToolTips Pin
kselman18-May-06 16:51
kselman18-May-06 16:51 
QuestionProblem with aborted thread.. Pin
ALQallaf18-May-06 15:17
ALQallaf18-May-06 15:17 
AnswerRe: Problem with aborted thread.. Pin
leppie18-May-06 16:45
leppie18-May-06 16:45 
AnswerRe: Problem with aborted thread.. Pin
S. Senthil Kumar18-May-06 23:04
S. Senthil Kumar18-May-06 23:04 

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.