|
hi all,
I am planning to implement a simple text editor in c#. Can anyone tell how to highlight the syntax after loading a file (which contains c# code) into a richtexbox.
Don't wait to hear a word of thanks from anybody when you help them instead ask them to help three other people and ask them to continue in chain.
|
|
|
|
|
There isn't a built in property. This has to be programmed.
|
|
|
|
|
You have to amend the raw rtf. This is quite a time consuming task.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i was able to play a wave file using a buffer object, but i want to check for the sample rate and other things from the wave file, via code, i thought i can do from the buffer object, for example i wanna check for the sample rate if it is 8k then i needed to converted some how to 44k, i know it will not make a difference in quality.
thanks
qkhader
|
|
|
|
|
will you please help me i am a bit confused i am getting controls on forms which are placed directly on form but not those which are placed on a container control
i am using
this.Controls
|
|
|
|
|
I guess you are doing this:
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
foreach (Control ctr in this.Controls)<br />
{<br />
Console.WriteLine(ctr.Name);<br />
} <br />
}
You need to recurse through the controls to check if they contain stuff
private void button2_Click(object sender, EventArgs e)<br />
{<br />
RecurseThroughControls(this.Controls);<br />
}<br />
private void RecurseThroughControls(System.Windows.Forms.Control.ControlCollection concol)<br />
{<br />
foreach (Control ctr in concol)<br />
{<br />
Console.WriteLine(ctr.Name);<br />
RecurseThroughControls(ctr.Controls);<br />
}<br />
}
I hope this solves your problem
Russ
|
|
|
|
|
it did thanks
|
|
|
|
|
I would recommend shortcutting the recursive call by checking ctr.HasControls()
|
|
|
|
|
Does anybody know how to enumerate all windows like in Task Manager, and get their handle?
Thanks.
|
|
|
|
|
To get the processes like task manager see the System.Diagnostics.Process class.
To get all the windows like spy++ see here
|
|
|
|
|
In my project i have a toolstrip with some 5 button in that. I want to assign the function keys (F1 to F5) for that buttons. How can i give this?
Also if nayone know please let me know how can i give Ctrl+charater to a button as shortcut?
Thanking you
Regards
Hari
|
|
|
|
|
Hi All,
Does anyone know how to create XslTransform object and load body from string instead of phisical file.
instead of doing this:
XslTransform xt = new XslTransform();
xt.Load("myFile.xsl");
do sth like:
string myContent = GetContentFromDatabase();
XslTransform xt = new XslTransform();
xt.Load(......myContent ......)??????
Cheers,
Kamil
|
|
|
|
|
Hi,
I have a C# Win application where I hosted a web browser control.
I have set the property "Suppress Script error" = true.
Now, While browsing some websites, Still I found script error debugging dialog. And after
hassling for a while, I was assured with pleasure that, the internet explorer's default
setting is disabled to debug script error. Only when I installed MS Visual studio 2005, Visual Studio
itself has turned the debugging option on, thats why I used to get annoying debugging script error window.
Now, I am wondering, as MS VS 2005 has turned this option on, so there must be some way to turn this option off
programatically using C#. So, I want to turn this "Script Ddebugging" off when my C# win software loads, and I want to turn the option ON again when my software exists.
Can anyone please give me any snippet to do this ?
Thanks and regards
Emran
|
|
|
|
|
hello friends,
well my question is quite simple enuff
how do we create a wizard in C#? I had made in Visual C++ 6.0 a long time ago but I cant remebr it now and I'm not able to find it.
thanks in advance
Rocky
|
|
|
|
|
This[^] should help you get started.
/ravi
|
|
|
|
|
Try Here:
http://www.codeproject.com/useritems/create_VS_wizard.asp
|
|
|
|
|
yea thanks alot, This material is looking helpful to me. Thanks alot both of u
|
|
|
|
|
Hi,
anyone any idea how i can get the ParameterMarkerFormat to help build my update query's ?
It has something to do with getschema() method of a dbconnection... i guess...
it should return the format to use my parameters in a query,
because the differ when SQLClient, Oledb or oracleclient is used.
Thx
Kurt
|
|
|
|
|
ok me again....
herewith the answer...
(its one long line)
ParameterMarkerFormat = connection.GetSchema(DbMetaDataCollectionNames.DataSourceInformation).Rows[0][DbMetaDataColumnNames.ParameterMarkerFormat].ToString();
Greetz.
Kurt
|
|
|
|
|
i use this code in my project
DirectoryInfo directory=new DirectoryInfo("..\\Agent");
string direc=directory.FullName;
the Agent folder located in bin folder
when i run the project from source it works
but if i run from setup project it give me error File Not Found
"I add the folder and incloded the files in setup project"
how can i solve it
thanks for help
MD_NADA
|
|
|
|
|
You need to set the current directory to the directory the program is in.
You can do this from code by using:
Directory.SetCurrentDirectory("C:\Where Ever My Program Is\");
(Directory is in System.IO)
Alternatively you can use the full path of the directory you need.
Note:
After reading bashiwala's reply, his solution is far better than mine. Use that one.
- Munty
-- modified at 10:27 Tuesday 21st November, 2006
|
|
|
|
|
I think, it is always a good practice to use Application.StartUpPath instead of using relative path reference. Using Application.StartupPath is being evaluated everytime it is called so there is no impact of changing current directory.
|
|
|
|
|
Hi,
I newbie in .Net. I have developed a Windows service with the help of C#.It is working fine once it has been started successfully.
But I am getting an error when try to RUN that service from service manager. Though it has been set the start type to "Automatic". Service manager was failed to start that.
So, I have tried to start it manually and got this ERROR:
"The [service name] on Local Computer started and then stopped. Some srevices stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
I should mention here, sometimes this problem has been overcomed by restarting the System. But most of the time the problem was there even after restarting the system.
Please Help me to fix the problem asap.
|
|
|
|
|
Erhm, the problem (ofcourse) can have loads of causes. First of all, under which user do you start the process? Does that user account have enough rights?? What if you develop a windows application and you call the functions within your service. Do you have the same problem there??
Do you try to use a GUI, this is not allowed in Windows Services. Once again, I know too many causes.
I experienced the best way to develop a service is to create a Class Library project which contains all required functionality. Create a win application which calls all your functions in order to test them. Then once all code is tested and all errors are caught, you create a windows service which calls all functions.
While testing, use the same user account as your service does, and DON'T use a GUI within your Class Library.
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
If you would like an example of code that implements a service which does work, download the source code for my FileBackup program from Sourceforge: filebackup.sourceforge.net.
It runs a service called AutoBackupMonitor as user "LocalSystem".
Incidentally, you may find more info on what the problem is with the Service app you have written by running: sc query <servicename>
Also check the Event logs under Application.
|
|
|
|