Click here to Skip to main content
15,912,756 members
Home / Discussions / C#
   

C#

 
AnswerRe: Crystal report Problem Pin
T.EDY26-Jul-07 20:48
T.EDY26-Jul-07 20:48 
Questionload file names Pin
amilapradeep26-Jul-07 18:43
amilapradeep26-Jul-07 18:43 
AnswerRe: load file names Pin
Christian Graus26-Jul-07 18:47
protectorChristian Graus26-Jul-07 18:47 
GeneralRe: load file names Pin
amilapradeep26-Jul-07 19:17
amilapradeep26-Jul-07 19:17 
QuestionCapturing the Current Line of Text from RichTextBox [modified] Pin
bneacetp26-Jul-07 17:33
bneacetp26-Jul-07 17:33 
AnswerRe: Capturing the Current Line of Text from RichTextBox Pin
Abisodun27-Jul-07 2:23
Abisodun27-Jul-07 2:23 
QuestionRe: Capturing the Current Line of Text from RichTextBox Pin
bneacetp27-Jul-07 15:02
bneacetp27-Jul-07 15:02 
AnswerRe: Capturing the Current Line of Text from RichTextBox Pin
Abisodun28-Jul-07 3:54
Abisodun28-Jul-07 3:54 
I'm sure there are several solutions but my first thought is as follows: e.g.

first
second
third
fourth that wraps fourth that wraps fourth that wraps fourth
that wraps

string[] lines = richTextBox.Lines;
i.e.
lines[0] returns "first",
lines[3] returns "fourth that wraps fourth that wraps fourth that wraps fourth that wraps".

1) Create a class LineClass with properties: int FirstCharacter, int LastCharacter, string Line.
2) Add an entry for each line to a List<LineClass>. Remember there is a return character between lines so that in my example:
first instance of LineClass FirstCharacter=0, LastCharacter=4, Line=first
second instance of LineClass FirstCharacter=6, LastCharacter=11, Line=second

3) Use GetFirstCharIndexOfCurrentLine to determine the cursor location.
4) Loop through List<LineClass> to get the line you need.

If the line is a result of wrapping, your answer in 3) will fall between FirstCharacter and LastCharacter for that entry. Otherwise it will equal FirstCharacter.

Good Luck.
QuestionHow to know if a DataTable has been created? Pin
Khoramdin26-Jul-07 12:59
Khoramdin26-Jul-07 12:59 
AnswerRe: How to know if a DataTable has been created? Pin
Christian Graus26-Jul-07 13:52
protectorChristian Graus26-Jul-07 13:52 
AnswerRe: How to know if a DataTable has been created? Pin
T.EDY26-Jul-07 16:28
T.EDY26-Jul-07 16:28 
AnswerRe: How to know if a DataTable has been created? [modified] Pin
Eliz.k26-Jul-07 20:37
Eliz.k26-Jul-07 20:37 
QuestionHow to seperate the Two string? Pin
Khoramdin26-Jul-07 10:31
Khoramdin26-Jul-07 10:31 
AnswerRe: How to seperate the Two string? Pin
PhilDanger26-Jul-07 10:39
PhilDanger26-Jul-07 10:39 
AnswerRe: How to seperate the Two string? Pin
Judah Gabriel Himango26-Jul-07 10:40
sponsorJudah Gabriel Himango26-Jul-07 10:40 
AnswerRe: How to seperate the Two string? Pin
Eliz.k26-Jul-07 20:50
Eliz.k26-Jul-07 20:50 
GeneralRe: How to seperate the Two string? Pin
Malcolm Smart26-Jul-07 21:08
Malcolm Smart26-Jul-07 21:08 
GeneralRe: How to seperate the Two string? Pin
Eliz.k26-Jul-07 22:38
Eliz.k26-Jul-07 22:38 
QuestionBest way to populate grid? [modified] Pin
zaboboa26-Jul-07 10:22
zaboboa26-Jul-07 10:22 
AnswerRe: Best way to populate grid? Pin
Judah Gabriel Himango26-Jul-07 12:56
sponsorJudah Gabriel Himango26-Jul-07 12:56 
AnswerRe: Best way to populate grid? Pin
Eliz.k26-Jul-07 20:55
Eliz.k26-Jul-07 20:55 
AnswerRe: Best way to populate grid? Pin
Urs Enzler26-Jul-07 20:56
Urs Enzler26-Jul-07 20:56 
GeneralRe: Best way to populate grid? Pin
zaboboa27-Jul-07 11:57
zaboboa27-Jul-07 11:57 
GeneralRe: Best way to populate grid? Pin
Urs Enzler28-Jul-07 4:48
Urs Enzler28-Jul-07 4:48 
QuestionHow to get a foreign key lookup value in datagridview Pin
xdavidx26-Jul-07 10:13
xdavidx26-Jul-07 10:13 

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.