|
Anyone know how to do multiline indent/outdent? Like in Visual Studio...select multiple lines, press Tab, and it indents the selected lines. I'm doing this in a RichTextBox. Thanks.
I've searched both Google and this site but have found nothing. (By indent, I don't mean the indent property, I mean adding a tab in front of every line)
Thanks.
|
|
|
|
|
Indent:
richTextBox1.SelectionIndent += 10;
Outdent:
richTextBox1.SelectionIndent -= 10;
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
As in...by tabs...('\t') character. I figured out the indent part actually...I just need the outdent.
|
|
|
|
|
Didn't SelectionIndent work?
I wonder how you programmed Multiline Indent action by inserting '\t' characters!! By a loop?
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
SelectionIndent adds a real indent to the box. I want to take away the tab character at the front of each line if it exists. I think I may have just figured out how. And yes, I used a loop to add in the '\t' characters.
|
|
|
|
|
Well, I think you have some choices to do that but of course they're not too common!
For example:
"\t\t\tHi".TrimStart(new char[]{ '\t' });
Removes all '\t' chars from the beginning.
You can also use String.Split or maybe String.Substring or ... However, whatever you use, I think, you haven't a simple and clean solution. I still prefer SelectionIndent
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
|
|
|
|
|
Hello Everyone,
I am creating a small application that looks like an Excel Spreadsheet for scheduling purposes. It looks as such:
Employee Name 1 | Employee Name 2
11/01 8:00-10:00 Blah | 8:00-10:00 blah blah
11/02
11/03
What I am trying to do is allow each cell to have multiple selectable lines in it. For instance:
Employee Name 1 | Employee Name 2
11/01 8:00-10:00 Blah | 8:00-10:00 blah blah
12:00-1:00 Lunch |
11/02
11/03
I have seen other applications that are able to do this without creating another row and duplicating the date. I have read and read but I can't seem to find anything that points me in the proper direction, most likely due to the fact that I don't know what keywords to look up in order to find what I am looking to do. Any pointers in the right direction of how to achieve this would be greatly appreciated!
|
|
|
|
|
Hallo
i'm writing the GUI for some console applications and i want to include those apps directly in the GUI executable.
In particular, i'm writing a brief program to launch (in sequence) DISKPART and imagex to restore an os onto a specified partition.
could you point me to any resource about?
thanks in advance
R
|
|
|
|
|
You can add the console application as an embedded resource, extract it at runtime and use Process class to start it. Here is a similar example: Bat file compiler[^]
|
|
|
|
|
Hey guys,
I'm calling the Process.Start() methode on an application that once started, it fires up a new application and exits so as you can see, another process is actually started by the originally lanched process which I cant monitor when it exits "the newly lanched application", you may like to call this "handing over".. Any idea how can we catch the later application and monitor when it exits??
Thanks guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
|
Mika Wendelius wrote: Perhaps you could use Process.GetProcessesByName method[^].
Thanx Mika!!
GetProcessesByName was EXACTLY what I needed
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
You're welcome
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi Muammar©,
When the first process creates the second process, it could obtain the new Process ID and return that
as its exit status, so you can use it in a batch file or any other process.
|
|
|
|
|
Hey Luc,
Luc Pattyn wrote: When the first process creates the second process, it could obtain the new Process ID and return that
as its exit status, so you can use it in a batch file or any other process.
Hmmm.. And how do you do that??
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi Muammar©,
some C# code:
Process p=Process.Start(...);
int id=p.Id;
Environment.ExitCode=id;
Application.Exit();
and some batch code:
C:\process.exe
set PID=%ErrorLevel%
|
|
|
|
|
Thanx Luc! I did it, I just needed to use the GetProcessByName
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello,
i am new in this forum and it seems to, that here are a lot of very wellknown people, who maybe could help me.
I would like to program a ActiveX-Control in C# to visualize the data of an acceleration sensor, which works with x- and y-axis. The program, which provides the sensor data, has the possibility to include ActiveX-Controls. There´s also a Solution file, which can be used.
My problem is, i can program in C or C++, but i have never programmed in C# or .NET. Could somebody help me or has an idea, where i can get syntax or algorithm, to understand, how c# works? I use Visual Studio 2005 ! Thank you very much...
|
|
|
|
|
enginesan wrote: My problem is, i can program in C or C++, but i have never programmed in C# or .NET
That should not be hard since C# is quite similar to C/C++ in terms of most of the syntax.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi Paul,
first, thanks for answering!
That´s right. The syntax is quite similar. But my knowledge in programing OOP is very small. So i have no idea,
how to start. It would be perfect, when i could send the solution file to somebody here and he/she could give me
a description with some examples which i could study.
|
|
|
|
|
Google search on introduction to oop in c#[^] turns up quite a bit of what looks like good results to check out.
Sending a solution file may not be the best idea.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Just the other day I reread an earlier (1996) C++ programming book. I was quite shocked to see how similar C# is to C++. If you are familiar with C++ you shouldn't have any troubles. Work through a few simpler program ideas to get the jist of the syntax and the .net classes then break your goal application down into seperate sections and code away! If you can do C++ then C# will be no problem - a pretty shallow learning curve.
If you have any issues with particular parts of your code, feel free to post back explaining what you've tried and the issues you're facing and you'll find many people glad to help
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Environment: Visual Studio 2005 with .Net 2.0
OS: Windows XP
I have a round shape image file that I want to associate with my button control on a WinForm application. How do I make the button appear as a round shape image at run-time?
|
|
|
|
|
Look at the Region property of the button.
There are also articles on CP regarding this. Search for non-rectangular form.
|
|
|
|