|
is there a winform label control that can support HTML tags?
I dont want to use richtextbox.
I have no special talents, I am only passionately curious.Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted"
-(Albert Einstein)
|
|
|
|
|
From what i understand, you need a label control and not a textbox.
There is no inbuilt control for that for winforms as such.
However, on similar lines, you can use this one by Palomraz
http://www.codeproject.com/vb/net/rtflabelcp.asp
Doe that solve your purpose, or am I not near your question?
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
thanks for the reply
i have already seen that solution and it seems you have to call an .rtf file to display as the label content.
what i wanted is a simple label control that can support HTML tag so when i do this for example:
The total transaction for this account is <b>100,000.00</b>, please be notified.
so by doing this i can only select the portion of the sentence to be bold or colored.
I have no special talents, I am only passionately curious.Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted"
-(Albert Einstein)
|
|
|
|
|
OK now i understand.
So for this you can override the label control, and use the EmbedHTML/MapHTML script display inline HTML, which is what RichTextBox uses internally.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
can you please point me to a link or a demo sample on how to do this?
or by using the EmbedHTML/MapHTML script display inline HTML for richtextbox.
thanks a lot
|
|
|
|
|
OK. The way I did it was by hosting an .htc inside my custom control.
This HTc did the trick of acting like a label.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
hi,
i'm not expert in C# i have small question is there any tool in
C# like RMI package in Java
Regards,
Charbel Asmar
|
|
|
|
|
The equivalent for RMI in .NET is remoting. Search and checkout the articles on this website to get an idea of what it is and how you can start building with it.
WM.
What about weapons of mass-construction?
|
|
|
|
|
RMI in Java is same as Remoting in .NET
Dependency on similar technology at bothe the ends and an elaborate and sophisticated RPC mechanism. I suggest read the book by Ingo Rammer, the best one in the market.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
I use VS 2005 and C# for only two weeks and I'm desperate in this problem. My program, (screenshot), has two columns with the same content - buttons and textboxes. I really don't know, how to create some simple code usable for both of them. These textboxes and buttons has similar names, like:
textBoxAInput, textBoxAIV, textBoxAIV2, richTextBoxARunda1IVBin; textBoxBInput, textBoxBIV, textBoxBIV2, richTextBoxBRunda1IVBin;
and there are buttons like: buttonTextA, buttonTextB
There is about 20 textBoxes in both colomns.
What can you recommend me to use: I want to have just one general program capable opperate with both columns? ...some delegates, or special classes, some universal usercontrol, maybe interface? I'm begginer in C# and I don't know well these special purpose "things".
The best idea I have is, if possible, using strings as names: pseudocode
void printsomething(char ID)
{
//ID is A or B
string nameIV1 = new string("textBox" + ID + "IV1");
nameIV1.Text = "something"; //any idea, how to use "string as object name"?
}
I don't wanna use unsafe code, so there's no way using references, like:
if (sender.Equals(buttonTextA))
textBoxIV = &textBoxAIV;
else
textBoxIV = &textBoxBIV;
//or is something like that possible in "non-unsafe" code?
any idea, how to do this?
thank a lot for any help.
Source code and further informations about the program - here
|
|
|
|
|
Hello
I hope i got you right. Two things to mention:
1- If you want to access control by name like you stated use this.Controls["MyControlName"]
2- If you want to make a sinle event handler for several controls, select them all in the designer, then in the PropertyGrid write the name of the method you wish to handle the event in that event's field.
Or in the code write this:
MyButtonA.Click += new EventHandler(MyHandler);
MyButtonB.Click += new EventHandler(MyHandler);
Then MyHandler will handle the Click event in both buttons.
If you need more similar help, or if I missed something, please post more details of what you need.
Regards
|
|
|
|
|
Re 1: this.Controls["MyControlName"] : I've tested this way now, but it doesn't work. It throws an exception: "Additional information: Object reference not set to an instance of an object." I'm not sure, where's the problem:
String vstup1Hex = "richTextBox" + id + "1Hex"; //id is A
Controls[vstup1Hex].Text = Radix.Stream2Hex(Input, 16, 4); // doesn't work
Re 2: I use one handler for every pair of buttons for some time. But still, in this MyHandler function I have to determine, which textboxes I have to work with richTextBoxA1Bin or richTextBoxB1Bin, etc.
|
|
|
|
|
Hello
This exception means that the control with this name is not a memebr of the controls of the form. Two possible problems:
1- What is th id part?? is it a string? Check you casing because names are case sensitive in C#.
2- You've put your control in a container control, eg. GroupBox, Panel, etc... If this is the case use MyGroupBox.Controls[ControlName] instead because the button is a member of the groupBox's controls not the form's controls.
PS.
Don't forget to cast the control into the type that you want if you need to, eg.
if(Controls["MyButton"] is a Button)
{
((Button)Controls["MyButton"]).PerformClick();
}
-- modified at 17:45 Saturday 9th September, 2006
BTW:
The screenshot link is working now, and I took a look at your form. It's number two. You have to access the control by the GroupBox name.
Regards
|
|
|
|
|
Yes, I have specified the GroupBox names and now, it works. Thanx a lot!
|
|
|
|
|
Does anyone know how to retreive the command line arguments for an existing external process ? StartInfo.Arguments does not contain it.
|
|
|
|
|
Hello
Why, I wonder?? Arguments should be in that property!! Try using the ProcessStartInfo.Verbs property instead.
Regards
|
|
|
|
|
Verbs does not contain any command line args at all. It purpose of use is very different. it indicates the actions that the system can apply to the file indicated by the FileName property of ProcessStartInfo class.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
Well do i assume that the external process is a managed app?
Anyways, any process started with command line arguments, has them stored in the process primary stack, since they are in scope of the entry point. You need to write a generic unmanaged code piece to access the string array passed into the entry point by the c runtime in an unmanaged process. For a managed app you need to get the pointer location of the entrypoint and then in contigous to the it would be the command line arguments passed in. you can see where the arguments finish by wrapping your search before any instruction address or jmp instruction appears.
Does that make something clear here?
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
Hi every body please can you tell me or give me some url where i can find how is made documentation.Is it in documentation includet help?
when i want to read something good just seat and type it
|
|
|
|
|
|
Hello,
ComponentOne's Doc-To-Help makes help creation easy. You can write your help source documents in Microsoft Word (Doc-To-Help for Word and Enterprise) or HTML (Doc-To-Help Enterprise only), then use Doc-To-Help to generate the help files. It allow you to generate Help 2.0, .chm, JavaHelp, printed documentation, and WinHelp files. The Documenter.NET portion of Doc-To-Help will generate help automatically from a .NET assembly. For more information, please visit http://www.doctohelp.com/[^].
Suelinda W
Customer Engagement, ComponentOne LLC
|
|
|
|
|
Hi,
I was trying to close my application but it doesn't work as the Task Manager still showing that it is running. I'd search around the Internet and tried Environment.Exit(-1), Thread.CurrentThread.Abort() but nothing works.
Any idea?
Thanks in advance.
Jie Liang
|
|
|
|
|
Hello
If your application is multithreaded -which I suspect-, Probably one of your foreground threads is still running. Either keep track of your threads and abort them on exit -or end them more gracefully if possible-, or set them to background threads so that they exit themselves upon the program termination.
Regards
|
|
|
|
|
Hi
Thanks, it works, the Task Manager don't show the process any more when I exit the application
Jie Liang
|
|
|
|
|
Well depends on the CLR. when main returns, main still is the primary thread, but a manged thread. It will depend on whims n fancies of the CLR. CLR will take some time to reflect the thread stoppage, depending on other work it is involved in. So no need to be worried.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|