Click here to Skip to main content
15,907,392 members
Home / Discussions / C#
   

C#

 
QuestionSolving (string) and creating the screen - Ex.: CreateScreen("screenTest") Pin
User 68218818-Feb-10 4:06
User 68218818-Feb-10 4:06 
AnswerRe: Solving (string) and creating the screen - Ex.: CreateScreen("screenTest") Pin
Not Active8-Feb-10 4:20
mentorNot Active8-Feb-10 4:20 
GeneralRe: Solving (string) and creating the screen - Ex.: CreateScreen("screenTest") Pin
User 68218818-Feb-10 4:38
User 68218818-Feb-10 4:38 
AnswerRe: Solving (string) and creating the screen - Ex.: CreateScreen("screenTest") Pin
V.8-Feb-10 4:24
professionalV.8-Feb-10 4:24 
GeneralRe: Solving (string) and creating the screen - Ex.: CreateScreen("screenTest") Pin
User 68218818-Feb-10 4:37
User 68218818-Feb-10 4:37 
AnswerRe: Solving (string) and creating the screen - Ex.: CreateScreen("screenTest") [modified] Pin
rhuiden8-Feb-10 4:43
rhuiden8-Feb-10 4:43 
GeneralRe: Solving (string) and creating the screen - Ex.: CreateScreen("screenTest") Pin
User 68218818-Feb-10 11:47
User 68218818-Feb-10 11:47 
Questioncontrols in richtextbox Pin
asdf232118-Feb-10 3:19
asdf232118-Feb-10 3:19 
Hi,


I have got a serious problem. I have connect a table with the windows form. The table looks like


Id name age place country

1 sss 11 ttt qqq

2 ww 12 eee qqq



Now I'm able to display all of them in a richtextbox in the following format whose country = qqq

1.

Id ="1"

Name = "sss"

age =11

place = "ttt"

country = "qqq"

2.

Id ="2"

Name = "ww"

age =12

place = "eee"

country = "qqq"


now i add a linklabel control to the textbox. the text of the linklabel wiill be the result of Name column when on click it is linked to a webpage.

here my problem is it is not scrolling along with text.

this is how my code looks :


public void button3_Click(object sender, EventArgs e)
{
OdbcCommand bcC2 = new OdbcCommand();
bcC2.CommandText = "select * from C_RefCitation where c_id like ('" + textBox5.Text + "')";
bcC2.Connection = OdbcCon;
DataSet q3 = new DataSet();
OdbcDataAdapter db1A2 = new OdbcDataAdapter(bcC2);
db1A2.Fill(q3);
dataGridView1.DataSource = q3.Tables[0];
richTextBox2.Visible = true;
richTextBox2.Clear();
for (int x = 0; x < dataGridView1.Rows.Count - 1; x++)
{

richTextBox2.AppendText((x + 1).ToString() + ". ");

for (int y = 0; y < dataGridView1.Columns.Count; y++)
{
richTextBox2.AppendText("\n");
richTextBox2.AppendText(dataGridView1.Columns[y].HeaderText);
richTextBox2.AppendText(" : ");
if (dataGridView1.Columns[y].HeaderText.ToString() == "c_CitationDOI")
{

this.richTextBox2.SelectionStart = this.richTextBox2.TextLength;
int index = richTextBox2.Text.Length;
Point position = richTextBox2.GetPositionFromCharIndex(index);
LinkLabel label = new System.Windows.Forms.LinkLabel();
RichTextBox sri = new System.Windows.Forms.RichTextBox();
label.Text = dataGridView1.Rows[x].Cells[y].Value.ToString();
label.AutoSize = true;
label.Location = new Point(0,position.Y);
label.LinkBehavior = LinkBehavior.NeverUnderline;
richTextBox2.Controls.Add(label);
richTextBox2.AppendText(label.Text);
label.Links.Add(1, 7, dataGridView1.Rows[x].Cells[y].Value.ToString());
label.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.label_LinkClicked);
}
else
{
richTextBox2.AppendText(dataGridView1.Rows[x].Cells[y].Value.ToString());
}
if (y != dataGridView1.Columns.Count - 1)
{

richTextBox2.AppendText(", ");
}
}
richTextBox2.AppendText("\n\n\n ");
}

}



please help me in modifying this code so that the controls scroll along with text box.


Thank you very much
QuestionMultiple Clients Running One Server Application Pin
Bob Steel-Smith8-Feb-10 3:16
Bob Steel-Smith8-Feb-10 3:16 
AnswerRe: Multiple Clients Running One Server Application Pin
Keith Barrow8-Feb-10 3:42
professionalKeith Barrow8-Feb-10 3:42 
GeneralRe: Multiple Clients Running One Server Application Pin
Bob Steel-Smith8-Feb-10 4:23
Bob Steel-Smith8-Feb-10 4:23 
GeneralRe: Multiple Clients Running One Server Application Pin
Keith Barrow8-Feb-10 5:23
professionalKeith Barrow8-Feb-10 5:23 
GeneralRe: Multiple Clients Running One Server Application Pin
Bob Steel-Smith8-Feb-10 7:01
Bob Steel-Smith8-Feb-10 7:01 
GeneralRe: Multiple Clients Running One Server Application Pin
Keith Barrow8-Feb-10 9:29
professionalKeith Barrow8-Feb-10 9:29 
GeneralRe: Multiple Clients Running One Server Application Pin
Bob Steel-Smith8-Feb-10 16:34
Bob Steel-Smith8-Feb-10 16:34 
GeneralRe: Multiple Clients Running One Server Application Pin
Keith Barrow8-Feb-10 23:40
professionalKeith Barrow8-Feb-10 23:40 
QuestionData sync between two sql server? Pin
Tridip Bhattacharjee8-Feb-10 2:22
professionalTridip Bhattacharjee8-Feb-10 2:22 
AnswerRe: Data sync between two sql server? Pin
Not Active8-Feb-10 2:55
mentorNot Active8-Feb-10 2:55 
AnswerRe: Data sync between two sql server? Pin
Giorgi Dalakishvili8-Feb-10 19:47
mentorGiorgi Dalakishvili8-Feb-10 19:47 
QuestionHigh DPI Issue Pin
musefan8-Feb-10 1:42
musefan8-Feb-10 1:42 
QuestionReturning web controls from a web service Pin
Vaibhav06108-Feb-10 1:27
Vaibhav06108-Feb-10 1:27 
AnswerRe: Returning web controls from a web service Pin
Not Active8-Feb-10 2:00
mentorNot Active8-Feb-10 2:00 
AnswerRe: Returning web controls from a web service Pin
kevinnicol8-Feb-10 2:20
kevinnicol8-Feb-10 2:20 
QuestionUsing SQL Application in network Pin
Reza Shojaee8-Feb-10 0:07
Reza Shojaee8-Feb-10 0:07 
AnswerRe: Using SQL Application in network Pin
42774808-Feb-10 0:17
42774808-Feb-10 0:17 

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.