 |
|
 |
Why didn't you inherit from TextBoxBase? - also the scroll bars don't "look right", and text box scrolls down by a line when clicking on blank space past the content.
Kris
|
|
|
|
 |
|
 |
Today seems no one is building control on his own, especially not in .NET, and TextBox and RichTextBox controls are not providing enough freedom to change them entirely to our needs. (and building stuff from scratch isn't RAD?!?!) Took a peek on code, well written.
|
|
|
|
 |
|
 |
Salamun ala manitabial hida
I want to use the TextBox.Select(int startIndex,int length )to select a part of text by giving the start index and the length . But ColorTextBox position instead of startIndex.
How can I enable this?
Please inform me.
|
|
|
|
 |
|
 |
With a rich text box, one can use the SelectionBackColor property to set the current selection's background color (ie: useful for syntax highlighting). In color text box, this only sets the background color used when the user selects text. Is it possible to correct that it functions like a rich text box, and one would be able to permanently highlight syntax by changing the text's background color? Thanks.
_________________
Software Engineer
Penn State Facilities Engineering Institute
|
|
|
|
 |
|
 |
Hello again!
I haven't done any active development of the Control in the last 6 months or so, so I'm not sure if the requested feature can be implemented easily, but you're definitely right: the SelectionBackColor property should be renamed to avoid confusion. I will also try to provide a proper implementation for the property but this may require some work, because this has to be done in the rendering algorithm, which has been optimized for speed and not for maintainability
|
|
|
|
 |
|
 |
How can I trap events with this color text box if KeyUp and KeyDown are not implemented? It seems a little odd for a text-editor style box. It would be extremely annoying to have to trap all key events by its parent form instead.
I have the latest build you have listed (3-25-07). Any ideas why these two wire-up events don't work if I manually add them? Thanks.
_________________
Software Engineer
Penn State Facilities Engineering Institute
|
|
|
|
 |
|
 |
As a work-around, I set my form's KeyPreview property to true, trapped KeyUp and KeyDown there, then had the form call the relevant methods for keyup and keydown of the ColorTextBox control. This isn't pretty, but it works.
_________________
Software Engineer
Penn State Facilities Engineering Institute
|
|
|
|
 |
|
 |
This is probably a bug in ColorTextBox. The Control inherits from the UserControl class and overrides most of the On methods, so it may be that the overriden methods do not call the base implementation and therefore the respective event is not fired! I will look into this issue as well!
|
|
|
|
 |
|
 |
First, I'd like to let you know that I've selected your project to include in my next application which will be shared under the GNU GPL. Thanks for spending the time to create and release this: it's decently refined and also does a super fast render!
My question:
Is there a way to disable anti-alias for font smoothing? My application is a scripting client, and the font smoothing isn't preferred. It would be nice to have this as a public constructor to toggle the smoothing type to give users more control.
What I found:
In the ColorTextBoxDrawing.cs file, of the initGraphics method:
(some Graphics reference).Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
I've tested this functionality myself, both in the intiGraphics method as well as everywhere else you take in a Graphics parameter, but it seems to be failing. Are you overriding this somewhere else where I've overlooked? Thanks!
_________________
Software Engineer
Penn State Facilities Engineering Institute
|
|
|
|
 |
|
 |
Hi! Sorry for the late reply, but I was on vacation and didn't notice your comments any sooner.
First off, I'm glad to hear that somebody finds this little Control useful and is actually using it. Regarding your comment on anti-aliasing - this shouldn't be hard to implement - I will look into that as soon as I can (i.e. as soon as I have enough time to do so)
Regards,
Christian
|
|
|
|
 |
|
 |
Thanks Christian! No problem on the slow response, as I know you haven't touched this project in quite some time. I found it when Googling for syntax highlighting and rich text box for ideas on how to streamline custom syntax highlighting.
With your color text box, I've been able to avoid having to dump too much energy into streamlining syntax highlighting (and syntax suggestion) since this text box control will render quickly any ways and provide a smooth experience for users. I particularly like the very fast rendering of the line numbering and position reporting features. I've implemented them manually before, but never with as much rendering speed as yours.
_________________
Software Engineer
Penn State Facilities Engineering Institute
|
|
|
|
 |
|
 |
Is there now a solution for disabling AntiAliasing available?
I would be very interested.
|
|
|
|
 |
|
 |
You can use the TextRenderingHint on the Graphics object:
Graphics g;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
|
|
|
|
 |
|
 |
the colortextbox is not available . its not showing the colortextboxdemo.cs design page and colortextboxdemo2.cs page. pls upload a correct zip it will be very helpfull
Thanks
with regards
Balagurunathan.B
|
|
|
|
 |
|
 |
Hi!
I'm not sure what you mean by "...its not showing the colortextboxdemo.cs design page". Do you mean that you cannot open the project with the Visual Studio Designer? If so, what version are you using? The UI was designed with Visual C# Express 2005. Perhaps you need to recompile the solution or import it if you are using a different version!
Regards,
Chris
|
|
|
|
 |
|
 |
Make sure you delete the ColorTextBox_Key.pfx file first. Save the solution, then close and reopen it.
_________________
Software Engineer
Penn State Facilities Engineering Institute
|
|
|
|
 |
|
 |
First of all, nice job !
I was looking for a custom editbox and this one is cool
I did find a bug though, at least I think so ...
When you set the Font at Designtime it changes visibly, but when you (re)compile, it automatically resets itself to the DefaultFont. I noticed this in the demo's as well. It is possible to change the font at runtime, but the DesignTime support isn't working here. The property seems to have no purpose at the moment.
Could you please post a fix for this?
Thanks
OD
|
|
|
|
 |
|
 |
Hi!
Thanks for the feedback. I'm currently working on some performance improvements for Cut/Copy/Paste operations which require some rework of the internal data structures, so the next release will not be available soon.
In the meantime you can fix the bug you mentioned simply by changing the DesignerSerializationVisibility attribute of the Font property from Content to Visible!
Look for the following line in ColorTextBox.cs:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
and change it to
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
This should solve the problem you encountered.
Regards,
Christian
|
|
|
|
 |
|
 |
Cool that worked just fine
Thanks for the quick reply, I also voted for this article, hope it gets up there soon
Cheers,
OD
|
|
|
|
 |
|
 |
I can't open the project cause a dialog asks me for a password. I have to import a key file "ColorTextBox_Key.pfx" but I am almost new to C# and don't know what I should do.
|
|
|
|
 |
|
 |
Deleting the key file should help...
|
|
|
|
 |
|
|
 |
|
 |
Quesion: Can we change font of selected text?
|
|
|
|
 |
|
 |
No, ColorTextBox is not intended to be a WYSIWYG editor. Calculating and rendering lines with different fonts is very costly and would slow down the whole component significantly.
However you can extend ColorTextBox to support different fonts, which requires some work as you have to override (nearly) all methods responsible for line drawing and calculation of the line metrics.
Unfortunately I do not have the time to do this, but if someone is willing to do so I'll be glad to assist!
|
|
|
|
 |
|
 |
:-DHi,
first of all, I have been looking for this control for sometime. I test the control using VB.NET. I want to be able to change textcolor on the fly, eg highlight words or whole line, etc
Issue, when set color, eg. ctb.SelectColor = Color.red, and type character. The color will not change. The color change only when you mark chars and change it using same property.
It seems that control allow only text color when you have text selected,then any char typed color will change.
Quesion: Can we change color of text at the cursor ?
|
|
|
|
 |