|
Please clarify on what do you mean by signature of the application and what do you want to do with this signature.....
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
hello guys... Lets say I have a text box on a form. I was trying to get the coordinates of a specific letter i-e "." (dot) when I type it, in text box on the form. For simple drawing this can be done but for typing, I am finding it hard. Any pointers will be appreciated...thnx
|
|
|
|
|
I think some lateral thinking is required for this.
First, find the coordinates of the text starting position. That will be the text box's Location, plus a bit for borders and padding, which you can either hard code as an assumption or infer from the difference between Size and ClientSize.
Then measure the text, using Graphics.MeasureCharacterRanges[^]* (you can create a graphics object from the text box itself if you don't have one). Use the Font object from the text box. Note that you aren't measuring the text within the textbox, but you're measuring the same string with the same font in the same graphics context, so it should be the right answer!
Finally simply add the measured text size to the inferred start of the client area.
(*: Not MeasureString. See this short article[^].)
|
|
|
|
|
nicely explained.......
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
A question: what are you going to do when you know the position where the user typed a 'dot (I assume by 'dot you mean the OEMPeriod character in Windows).
The reason I ask is: if you do not require pixel-perfect typographic accuracy, there is a way (if 'ugly') that does not use a 'Graphics object, or 'MeasureString(...).
If you do require high-accuracy, then I'd definitely go with Bob Janova's excellent answer (his answer just got my #5).
And, if the scenario is one where you know the Font being used in the TextBox is mono-spaced (i.e., Courier or the like), then there is a much simpler way (not so 'ugly,' either).
You want to see code for 'ugly,' just ask here
best, Bill
"In the River of Delights, Panic has not failed me." Jorge Luis Borges
|
|
|
|
|
iam working on c# 4 solution
i have datagridview
i add datagridviewimagecolumn to datagrid
i give it fixed image from embded resource from design not from code
in design & in the run the default (x image) appear & my image doesn't appear
so what is the probelm
md_refay
|
|
|
|
|
Hellou,
Want to make a simple dictionary, translator which uses Google API to translate from English to Spanish, and inversely. All that is done, but now I want to make dictionary gets data from Clipboard if it's a text, and is no longer of 4,5 words.
I have found this class and operations with that class:
IDataObject iData = Clipboard.GetDataObject();
if(iData.GetDataPresent(DataFormats.Text))
{
textBox1.Text = (String)iData.GetData(DataFormats.Text);
}
I've tried to put this in Timer tick event but have problem cause interval doesn't allow me to manually add other text. I could put higher interval, but that doesn't give on performance and again is possible to change user input when event is raised.
It's very important to know that I want to retrieve data when somewhere from outside of program I copy some text (for exl. Word, Calculator, etc.).
Any help? Thanks
|
|
|
|
|
Not without using some P/Invoke to get information about when the clipboard changes. The Clipboard class doesn't expose any events.
You could try retaining a cache of what was in there last time you looked, and only setting the text if the clipboard contents have changed.
|
|
|
|
|
Sorry, don't undestand. I'm beginner.
|
|
|
|
|
This[^] article contains an implementation of Clipboard monitoring using P/Invoke.
|
|
|
|
|
See my Talking Clipboard[^] article for help on monitoring the clipboard. See my Google Translator[^] article for help on invoking Google's translation service from your app.
/ravi
|
|
|
|
|
I haven't got it.
Code which I posted here is working.
But, I need to make some process in VS which would watch nonstop over the clipboard and paste values if text is up to 256characters for example.
What invoke means exactly?
How to use that exactly?
when you have time answer, it's not important very much, just for learning
kind regards
|
|
|
|
|
By "invoke", I meant "call" or "use".
/ravi
|
|
|
|
|
i want to add image to (data gridview button column )but i don't know how
md_refay
|
|
|
|
|
|
i mean add image as background to button
md_refay
|
|
|
|
|
OK, try changing the keywords in the Google link I gave you and see what it comes up with.
|
|
|
|
|
what is the different between .net frame work 4 &.net frame work 4 client profile
i found these 2 option in the target frame work so what is the different & when to use each one
md_refay
|
|
|
|
|
|
|
How can I change the cursor size of mouse via C#.
I have checked that the Cursor.Size is readonly property.
thanks the world of codeproject.
I am waiting for ur ans.
Thanks!
|
|
|
|
|
I believe you'd have to create your own cursor and set it up through the Win32 API directly. There is no equivilient in the .NET Framework.
You can get started by reading this[^].
|
|
|
|
|
Is it possible to give me a source or examples ?
|
|
|
|
|
The cursor size is a global (OS level) setting, and allowing applications to change it would be asking for usability nightmares.
You can, however, use a custom cursor, and you can create one which is a large pointer. Create a .cur file by the usual means, include it as a resource in your assembly and use this Cursor constructor[^] to load the resource stream.
|
|
|
|
|
Hi, I have a bindingsource binding to several text controls. I want to use the bindingsource.addnew() method to add a new line in the list, then move to the last record. My purpose is to set all these text controls empty to wait for input for the last record. But it failed. The bindingsource.position can not been set to the last record.
Could you please help to solve this problem? thanks.
|
|
|
|