|
How???(Do you know?) I need the position of the letter
|
|
|
|
|
Yes, you need the position of the letter, we understood this in your first posting.
But unless you're telling us exactly what you want we'll have to guess what you mean.
If you want the location of the first character in a RichTextBox on your screen your should use RichTextBox.GetPositionFromCharIndex() .
mav
|
|
|
|
|
mav.northwind, I'm sorry.
My English is not good. I mean the index is what I want.
|
|
|
|
|
Hello,
I have a ToolBar in my MDI child form. My toolbar buttons are set to display text to the right of the image.
My problem is that all the buttons are sized equal, and I wish each to have a different size, depending on the length of the text. The button size is 22 x 22, which is about enough for a 16 x 16 image with no text. One would think about the AutoSize property, but it relates to the toolbar and not the buttons.
Any ideas? Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Create your own derived toolbar item class ( I forget the class name ) and then you can set the item size to be whatever you want.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
ToolBarButton .
I was looking at the ToolBarButton docs, and I didn't find any property, public or protected that I could override. Any pointers?
Thanks,
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
In a very large richTextBox I want to find all letters.
Is there something faster than :
char[] letters={ 'a','b','c','d','e','f','g','h','i', 'j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S',<br />
'T','U','V','W','X','Y','Z'} ;<br />
richTextBox1.Text.IndexOfAny(letters, i);
OR
richTextBox1.Text[i].IsLetter;
|
|
|
|
|
I'm not sure how much faster it'd be, but have you looked at System.Text.RegularExpressions?
Optionally, you could check the text each time a new character is entered to see if it's a letter, then just set some boolean flag indicating whether all characters are letters.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
I doubt you could make it slower....
Use RegEx, or IsChar on each character as they are typed, as has been suggested.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I want to make blue color all words
int position=0;<br />
char[] KeywordsCanStartWith = {'_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',<br />
'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I',<br />
'J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'} ;<br />
char[] KeywordsEndBeforeApears = {' ','\t','(',')',',','.',';','\n','[',']','{','}','+','-','*','/',':',<br />
'=','<','>','|','\\','&','%','?','$','!','"','#','\'','@','^'} ;<br />
bool LogVar;<br />
void giveColorToKeywordsInRTB(object sender, System.EventArgs e)<br />
{<br />
position=0;<br />
KeywordStartsHere=-1; caretPos=richTextBox1.SelectionStart; <br />
LogVar=true;<br />
LockWindowUpdate(richTextBox1.Handle);<br />
richTextBox1.Select(0, richTextBox1.Text.Length);<br />
richTextBox1.SelectionColor = Color.Black ;<br />
while(LogVar)<br />
{<br />
KeywordStartsHere = richTextBox1.Text.IndexOfAny(KeywordsCanStartWith , position);<br />
if(position<0)<br />
break ; <br />
if(position==KeywordStartsHere)<br />
{<br />
position = richTextBox1.Text.IndexOfAny(KeywordsEndBeforeApears, position) ;<br />
if(position==-1)<br />
position=richTextBox1.Text.Length-1 ;<br />
else<br />
position--;<br />
richTextBox1.Select(KeywordStartsHere, position-KeywordStartsHere+1);<br />
richTextBox1.SelectionColor = Color.Blue ;<br />
}<br />
}<br />
if(++position > richTextBox1.Text.Length-1)<br />
LogVar=false;<br />
}<br />
}
|
|
|
|
|
Judah Himango and Christian It is a source code editor that makes use of
/*, */, //, "" to make some pieces green etc. So I must jumb from point to point.
That's why I prefer to use .IndexOf instead of .IsLetter.
Could you give me an idea of how to use the solution you suggest(with a litle piece of code if it is possible?)
|
|
|
|
|
Just look up regular expressions in MSDN.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
The RichTextBox will choke badly once you have a few more lines (try 1000+). If you want fast (close to linear) ( ) look at the code of my editor (link below). Even if your detection routines are fast, the RichTextBox will choke on both its find methods and it drawing methods, and there is NOTHING you can do about that, except write your own editor from scratch like i did, and integrate a proper lexical analyser to do the work.
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
Thank you very-very much leppie.
|
|
|
|
|
|
Hello
i want To use date format MMM,yy (month in a word and year in 2 digits )
but the month is in the language of the system (from the regional option)
i want the month to by in English without changing the language in the windows system
thanks allot
aviram
|
|
|
|
|
Try:
CultureInfo ci = new CultureInfo("en-US");
string strDate = myDate.ToString("MMM,yy", ci); That should work!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I have a C# solution consisting of a single project - in that project are 3 UserControls - every now and again the usercontrols i have placed on the forms just disappear and I have to start from scratch adding them to the forms again. It happens if the project build doesn't compile fully because I have mispelt something. Why does that happen? Is there a solution and if not what use are usercontrols?
|
|
|
|
|
I'm debugging a Web service with debugger stepping into the web service code from within debugging session of the web client. Problem is that exception is being thrown by system saying that call to the web service timeout while it takes me a while to step through the service code. Is there a way to make it wait infinitely?
Help!
Thanks a lot!
|
|
|
|
|
How do I apply an attribute to a return value of a method?
Thanks,
Yaakov
|
|
|
|
|
|
Hi
I don't know how to get really visible rectangle of my window, taking into account that it can be overlapped by other window(s). May be anybody had been faced this problem already?
|
|
|
|
|
Hi Gurus,
I have a business component which access data layer. All my aspx files uses this business component to access database activities.
I am creating few ViewState parameters in Business component and it turn trying to use from aspx files. I am unable reference ViewState parameters, it always return null value.
Is it possible to access ViewState parameter which are created in Business components to access in *.aspx files after postback events..?
Thanks for your time and suggestion
Yash
|
|
|
|
|
I would appreciate it if somebody could kindly provide the current settings for modern video cards with regard to screen resolution? The values that I currently have are as follows:
640 x 480
800 x 600
1024 x 768
1152 x 864
1280 x 1024
Would appreciate a listing for more modern video card settings. My video card was made circa 1997. To provide the requested assistance, please go to the Start menu, select Control Panel, select Display, select Settings, then look in the control group Screen Area, and then drag the slider control from left to right. The values for the screen areas of the video card should be displayed in the control group area for each setting of the video card at each place that the slider control stops. At least, that is my understanding of how it is done on my computer given my O/S of Windows 2000 Professional. Would appreciate knowledgeable feedback regarding current screen resolutions of modern video cards.
New_Phoenix
|
|
|
|
|
Mine is capable of about 45 different resolutions all the way up to 1920 x 1440. No, i'm not listing them here.
A better bet woul;d be to use DirectX and interrogate the driver that the user has installed to see what it supports, instead of taking a Poll...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|