|
tree.Invoke(new MethodInvoker(delegate
{
tree.Nodes.Add(dbNode);
}));
|
|
|
|
|
Thanks Daniel
my problem was solved, but why cross-thread problem occure (for avoid from cross-thread i have to use anonymous delegates)?
thanks
|
|
|
|
|
hdv212 wrote: but why cross-thread problem occure
That's the rule. Controls can be updated only from the thread which created it.
hdv212 wrote: for avoid from cross-thread i have to use anonymous delegates)?
To avoid cross thread exceptions, there is no need to use anonymous delegates. You use Invoke /BeginInvoke and supply delegate instance as parameter.
Instead of creating separate method, you can use anonymous delegates. There is no other difference.
|
|
|
|
|
Hi all
I want to write a C# program that will run in the background and listen to any Interaction with the printer and write to log files.
Please help by providing a source that can help me learn how to detect if the printer is printer?
I have been Googling but i couldn't get any source. Please help...
Thank you
Mosd
Be what you want to be
|
|
|
|
|
Mosd wrote: have been Googling but i couldn't get any source
Google Result
How To Detect Printer using C#[^]
Mosd wrote: I want to write a C# program that will run in the background and listen to any Interaction with the printer and write to log files.
use C# Brackground worker for that
cheers,
Abhijit
|
|
|
|
|
Hi all,
I have a string as follows.
string str = "the code project";
I want to convert it into rtf format. How can I do it in C#?
Thanks a lot.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
What do you mean rtf format? RTF is a text formatting system, so you can represent this string in many ways in rtf. For instance, you could have the word "the" in red characters and the rest in blue. Have a read of the rtf specifications to see what you need to put in. Here's a link[^] to the Word 2007 version of the rtf format.
|
|
|
|
|
Maybe he just wants to have no formatting, but just the text in rtf format. Like pasting a plain text into Winword and saving it as rtf.
If that's the case, one way is to fill a RichTextBox with your string and the get the value of then 'Rtf' property.
|
|
|
|
|
Yeah, as Blackjack said. It seems a little inefficient to keep a RichTextBox around, but it works and Microsoft will maintain it so you don't have to.
|
|
|
|
|
Or you could just do this once, and see what the result is, then use that to pad your literal string each time you need to convert something. From what I remember RTF just pads some special characters at the beginning and maybe end of the text, but unadorned text is just plain.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Ok, I'll explain it in this way.
Say my string it "Code project" I want to convert it into rtf format. So it should be lick this.
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 Code project\par
}
I mean copy-paste on notepad and open it on word pad, I can see a text line "Code project"
Hope it's clear now.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Can someone direct me to a tutorial or free solution that allows you to read the contents of a PDF in C# without either relying on Java or unsafe code that crashes every time you close it?
I searched through the articles on codeproject and the only thing I found that really only uses safe C# code is PDFSharp, yet this doesn't seem to be fit for actually reading a PDFs contents.
Thanks.
|
|
|
|
|
Your best bet for reliable code is to buy it. Otherwise, you're on your own.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Try this: http://text-mining-tool.com/[^]. It has a command line utility, if you want to use it from .NET code. For PDF it uses a java library (PDFBox), but it is compiled with IKVM, so it's just like having a .NET dll. If you want, you can use the PDFBox library directly, without that TextMiningTool. There's an article here on CP about that.
|
|
|
|
|
When using the PDFBox Library's classes I get several errors like this one:
Error 1 The type 'javax.swing.JFrame' is defined in an assembly that is not referenced. You must add a reference to assembly 'IKVM.GNU.Classpath, Version=0.30.0.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58'. <br />
And that is exactly why I said I'm looking for a solution without relying on Java
|
|
|
|
|
Did you put a reference to the IKVM.GNU.Classpath in your project? Is it the same version your are asked for?
Check this article: http://www.codeproject.com/KB/string/pdf2text.aspx[^]
If you need further help you can email me. Just put @gmail.com after my user name. Good luck.
|
|
|
|
|
Hi...
I am making website in c#.net. I want to show video in my website. I tried the following for dat.
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/8K_NQe57C-k" />
<param name="wmode" value="transparent" />
<embed src="http://www.youtube.com/v/8K_NQe57C-k" type="application/x-shockwave-flash"
wmode="transparent" width="425" height="350"/></object>
this shows the video correctly. But i want its values to come dynamically everytime from database. how to do this. Is der ne other way to achieve this.
|
|
|
|
|
This is not an asp.net forum.
pass variable name in src attribute of embed if you want to show it from a dynamic source. Search google and you will find many useful links.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Hello,
We are currently creating an application to include a external app to make it support tabbing. The including works fine trough the user32.dll functions SetParent and MoveWindow but the problem is when we click in the child window (which is located in a panel on the main form) the focus of the main form is actually lost. This results in clicking button twice on the main form incase we want to activate a single click function of a button.
bottomline, is there a way to include a child window into a panel and keep the parent form marked "focused" while typing into the child window?
Thanks in advance!
Bastiaan Nijkamp.
|
|
|
|
|
I have developed a windows application which uses a class library project.
Inside the class libraray project, I have added a file i.e. test.xml
How can I refer to this file from within the class library project?
p.s. This is a correction to my previous post...
Thanks
|
|
|
|
|
try
Application.StartupPath;
to get the path
|
|
|
|
|
Application. does not work inside the class library project
Any thoughts please?
|
|
|
|
|
Assembly.ExecutionAssembly.Location.
Never re-post. Just modify your earlier post
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Hi,
This does not seem to work inside the class library project.
|
|
|
|
|
I have used it and it works. Whats the error you are getting?
Ahsan Ullah
Senior Software Engineer
|
|
|
|