Click here to Skip to main content
16,021,905 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to use sgen.exe in postbuild events Pin
Rob Graham30-Apr-08 11:46
Rob Graham30-Apr-08 11:46 
GeneralRe: How to use sgen.exe in postbuild events Pin
Razvan Dimescu30-Apr-08 20:11
Razvan Dimescu30-Apr-08 20:11 
AnswerRe: How to use sgen.exe in postbuild events Pin
Ed.Poore30-Apr-08 11:54
Ed.Poore30-Apr-08 11:54 
GeneralRe: How to use sgen.exe in postbuild events Pin
Razvan Dimescu30-Apr-08 20:09
Razvan Dimescu30-Apr-08 20:09 
QuestionTab key functionality in editor user control Pin
Nouman Bhatti30-Apr-08 9:53
Nouman Bhatti30-Apr-08 9:53 
AnswerRe: Tab key functionality in editor user control Pin
Big Daddy Farang30-Apr-08 10:48
Big Daddy Farang30-Apr-08 10:48 
GeneralRe: Tab key functionality in editor user control Pin
Nouman Bhatti1-May-08 19:30
Nouman Bhatti1-May-08 19:30 
GeneralRe: Tab key functionality in editor user control Pin
Big Daddy Farang2-May-08 5:29
Big Daddy Farang2-May-08 5:29 
I think I can help you with that. Here is a little bit of code that you can adapt. I haven't tried this in C# but it's based on some C code I wrote a few years ago to replace tab characters in a text file with the appropriate number of spaces.

I'm assuming that you have a function that is called when the user presses a key, and that we've detected that the newest key press was a TAB character.
const int TabSpace = 8;
int CharsToAdd = (Control.Text.Length + 1) % TabSpace;
CharsToAdd = CharsToAdd ? TabSpace + 1 - CharsToAdd : 1;
while (CharsToAdd --)
	Control.Text = Control.Text + " ";


I'm also assuming that Control.Multiline == false. If it's set to true, then you'd need to find the start of the current line. That would be the first character after the "\r\n" and you'd replace Control.Text.Length by the current character position relative to the start of the line. (The first character after the "\r\n" is character zero.)

I hope this A) makes sense, B) helps. Smile | :)

BDF

A learned fool is more a fool than an ignorant fool.
-- Moliere

QuestionHow to get stored procedure parameters with SQLDMO ? Pin
hdv21230-Apr-08 7:17
hdv21230-Apr-08 7:17 
AnswerRe: How to get stored procedure parameters with SQLDMO ? Pin
Rob Graham30-Apr-08 11:56
Rob Graham30-Apr-08 11:56 
GeneralRe: How to get stored procedure parameters with SQLDMO ? Pin
hdv21230-Apr-08 20:34
hdv21230-Apr-08 20:34 
GeneralRe: How to get stored procedure parameters with SQLDMO ? Pin
goodideadave1-May-08 6:28
goodideadave1-May-08 6:28 
QuestionAfter printing a Word Doc using C#, I cant print from Excel but i CAN print from notepad or anything else... Pin
g1b30-Apr-08 6:56
g1b30-Apr-08 6:56 
AnswerRe: After printing a Word Doc using C#, I cant print from Excel but i CAN print from notepad or anything else... Pin
Arjun Marwaha30-Apr-08 7:41
Arjun Marwaha30-Apr-08 7:41 
GeneralRe: After printing a Word Doc using C#, I cant print from Excel but i CAN print from notepad or anything else... Pin
g1b30-Apr-08 8:29
g1b30-Apr-08 8:29 
Questionitextsharp form fields Pin
Uyi30-Apr-08 6:31
Uyi30-Apr-08 6:31 
AnswerRe: itextsharp form fields Pin
carbon_golem30-Apr-08 6:57
carbon_golem30-Apr-08 6:57 
Question[Message Deleted] Pin
cs.it.tech30-Apr-08 5:16
cs.it.tech30-Apr-08 5:16 
AnswerRe: any one help me,please Pin
Gareth H30-Apr-08 5:45
Gareth H30-Apr-08 5:45 
AnswerRe: any one help me,please PinPopular
J4amieC30-Apr-08 5:46
J4amieC30-Apr-08 5:46 
GeneralRe: any one help me,please Pin
cs.it.tech30-Apr-08 7:24
cs.it.tech30-Apr-08 7:24 
GeneralRe: any one help me,please Pin
leckey30-Apr-08 8:09
leckey30-Apr-08 8:09 
GeneralRe: any one help me,please Pin
leckey30-Apr-08 8:10
leckey30-Apr-08 8:10 
GeneralRe: any one help me,please Pin
J4amieC30-Apr-08 22:14
J4amieC30-Apr-08 22:14 
GeneralRe: any one help me,please Pin
leckey1-May-08 3:03
leckey1-May-08 3:03 

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.