Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: Screwed up a service. Pin
Xian29-Apr-04 5:47
Xian29-Apr-04 5:47 
QuestionHow to Make a MDI form itself XP theme aware Pin
TaoLi29-Apr-04 3:54
TaoLi29-Apr-04 3:54 
AnswerRe: How to Make a MDI form itself XP theme aware Pin
Heath Stewart29-Apr-04 4:25
protectorHeath Stewart29-Apr-04 4:25 
AnswerRe: How to Make a MDI form itself XP theme aware Pin
Heath Stewart29-Apr-04 4:27
protectorHeath Stewart29-Apr-04 4:27 
GeneralRe: How to Make a MDI form itself XP theme aware Pin
TaoLi29-Apr-04 4:37
TaoLi29-Apr-04 4:37 
GeneralRe: How to Make a MDI form itself XP theme aware Pin
Jon G29-Apr-04 5:24
Jon G29-Apr-04 5:24 
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Heath Stewart29-Apr-04 3:09
protectorHeath Stewart29-Apr-04 3:09 
QuestionRichTextBox-Coul you help me out? Pin
kumaru_san29-Apr-04 2:31
kumaru_san29-Apr-04 2:31 
hi all,

I tried to implement auto -indentation feature in my editor.
using some ideas from codeguru and codeproject .
i did the following code.

The problem is whenver i press "enter" key
the tab is incremented automatically in the next line.
(straight logic .if u see the code u will unerstand)

but i want the following feature :

if() (Enter key)
{ (Enter key)

MessageBox(); (Enter key)
DrawString(..); (Enter Key)

while(i>0) (Enter key)
{ (Enter key)

bool b = false; (Enter key)

} (Enter key)

} (Enter key)

else (Enter key)
{ (Enter key)

MessageBox(); (Enter key)

}


each time when i press "Enter" key the tab position
is changed . How to identify and move the tab
key properly.

Following is the fundamental code which i did .
How to improve this logic further.
I am struck up.Please help me.

Source code :

private void richTextBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
string temp="";
int indent=0;

if(e.KeyCode == Keys.Enter)
{
// taking previous line

string temp = Convert.ToString(richTextBox1.Lines.GetValue(richTextBox1.GetLineFromCharIndex(richTextBox1.SelectionStart - 1)));

// GetIndent() is used to count the tabs in the previous line


indent = GetIndent(temp,12);


System.Diagnostics.Trace.WriteLine(indent);


//adding one tab further in the next line



for(int i=0;i
GeneralNewbie: login screen Pin
ziwez029-Apr-04 2:15
ziwez029-Apr-04 2:15 
GeneralRe: Newbie: login screen Pin
Heath Stewart29-Apr-04 4:14
protectorHeath Stewart29-Apr-04 4:14 
Generalnetzwerk / network Pin
Anonymous29-Apr-04 1:56
Anonymous29-Apr-04 1:56 
GeneralRe: netzwerk / network Pin
Anonymous29-Apr-04 2:08
Anonymous29-Apr-04 2:08 
GeneralRe: netzwerk / network Pin
Daniel Turini29-Apr-04 2:28
Daniel Turini29-Apr-04 2:28 
Generaldetermine mouse button from System.EventArgs Pin
mookeroo29-Apr-04 1:16
mookeroo29-Apr-04 1:16 
GeneralRe: determine mouse button from System.EventArgs Pin
Stefan Troschuetz29-Apr-04 1:49
Stefan Troschuetz29-Apr-04 1:49 
GeneralRe: determine mouse button from System.EventArgs Pin
mookeroo29-Apr-04 1:53
mookeroo29-Apr-04 1:53 
GeneralRe: determine mouse button from System.EventArgs Pin
Syed Abdul Khader29-Apr-04 2:39
Syed Abdul Khader29-Apr-04 2:39 
GeneralRe: determine mouse button from System.EventArgs Pin
mookeroo29-Apr-04 2:32
mookeroo29-Apr-04 2:32 
GeneralWin32 Interop: Returning BSTR from ATL C++ DLL Pin
inter8ection29-Apr-04 0:07
inter8ection29-Apr-04 0:07 
GeneralRe: Win32 Interop: Returning BSTR from ATL C++ DLL Pin
Mike Dimmick29-Apr-04 0:53
Mike Dimmick29-Apr-04 0:53 
GeneralRe: Win32 Interop: Returning BSTR from ATL C++ DLL Pin
inter8ection29-Apr-04 1:06
inter8ection29-Apr-04 1:06 
GeneralRe: Win32 Interop: Returning BSTR from ATL C++ DLL Pin
Mike Dimmick29-Apr-04 2:15
Mike Dimmick29-Apr-04 2:15 
GeneralJustify alignment in c# ritchtextbox control!!! Pin
hassan azizi28-Apr-04 22:47
hassan azizi28-Apr-04 22:47 
GeneralRe: Justify alignment in c# ritchtextbox control!!! Pin
Heath Stewart29-Apr-04 4:03
protectorHeath Stewart29-Apr-04 4:03 
GeneralRe: Justify alignment in c# ritchtextbox control!!! Pin
hassan azizi29-Apr-04 4:42
hassan azizi29-Apr-04 4:42 

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.