|
Through property window changing form1/mainform text is is very easy. But i want change it at runtime but i can't access form1.text/this.text like property.Pls solve it?
|
|
|
|
|
Why can't you access it as a property? You can assign the Text property on the form to change the form's text. From inside the form class you can do:
this.Text = "New Title";
From outside the form class you can do:
form.Text = "New Title";
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
If i want to calculate time like this time / pages * 100 = time per 100 pages
for example:
00:05:00 / 5 = 00:00:01 * 100 = 00:01:40
Any suggest
tnx
|
|
|
|
|
Wasn't this answered a few weeks ago?
|
|
|
|
|
It was just a week ago this was answered, here[^]. All you have to do is apply a little math.
|
|
|
|
|
I answered this question in the thread that you created a week ago.
If you keep reposting the same questions without following up on the replies that you actually get, people will stop answering your questions all together.
---
single minded; short sighted; long gone;
|
|
|
|
|
... and you don't want to know what we'll do after that.
|
|
|
|
|
Hello!
C# newbie question
I have a text (length may vary) which I want to draw to a fixed size graphic. As "standard" I would like to use somthing like font size "arial 16" - but (and now it comes to my problem) if the text is too long to fit into the rectangle, a smaller character size should be used so that the text fits into the rectangle without clipping or ellipsis - even at the risk of having to read a text with fontsize "1"
Having a limit down to something like fontsize "8", and if the fontsize is smaller than 8 use ellipses would be great, but this would be the coronation
I looked through textrender and drawstring, but could really get an idea how to do it.
Anyone can help??
Thanks!
Jan
|
|
|
|
|
I remember that there was a method that give you the lenght of the string...
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
The function name was MeasureString... Search for it
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Hi,
Graphics.MeasureString() takes the same parameters as DrawString() except for the starting
point, and returns the size of the text.
You could first measure with some font size, then if too wide, reduce the font size
proportionally; as soon as the font size has been reduced by 50%, you could use the same
height to show two lines of text!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi!
I need to activate a function after 5 seconds that the form is running, i created this void fnction in the general class of the project and now i am trying to run it from the TimerHandler function and i get this error:
Error 1 An object reference is required for the nonstatic field, method, or property 'Update_Installer.Form1.Form1_Main()' C:\Documents and Settings\Yossi_Tubis\My Documents\Visual Studio 2005\Projects\Update_Installer\Update_Installer\Update_Installer\Form1.cs 121 13 Update_Installer
this is the TimerFunction:
private static void TimerHandler(Object myObject, EventArgs myEventArgs)
{
Form1_Main();
}
What i am doing wrong?
Thanks
|
|
|
|
|
Are you accessing a normal method withing a static one. In that case, you need to have an instance member and then call the normal method using the instance member right?
|
|
|
|
|
Are you sure you need your handler to be static? I never do...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
If i do not do it as static i am getting this error:
Error 1 An object reference is required for the nonstatic field, method, or property 'Update_Installer.Form1.TimerHandler(object, System.EventArgs)' C:\Documents and Settings\Yossi_Tubis\My Documents\Visual Studio 2005\Projects\Update_Installer\Update_Installer\Update_Installer\Form1.cs 112 31 Update_Installer
|
|
|
|
|
Hi
guys, i am working on console application in C# , from which i have to generate emails in large number, i want to give delay between sending emails, i am sending emails one by one with System.Net.Mail class and smtp classes, hows this possible any one got any idea, kindly let me know in ASAP, thanks in advance ,
regards,
|
|
|
|
|
Other than the delay in SMTP, SystemNetMail does not seem to have any Waits. One thing is that you can introduce a Thread.Sleep between email transmissions. The other way would be to check whether Persits MailSender MailQueue addresses your requirement.
|
|
|
|
|
King Shez wrote: from which i have to generate emails in large number,
People on CodeProject generally don't like spam. Is that what you are doing?
|
|
|
|
|
Going by his profile and the nature of the messages that he has posted, I just thought he should be a newbie with a requirement like Newsletters or similar thing.
|
|
|
|
|
Man i am not generating spam emails, i have to generate legal emails from my application to our users,
regards,
|
|
|
|
|
King Shez wrote: i am sending emails one by one with System.Net.Mail class and smtp classes
King Shez wrote: i want to give delay between sending emails
So you want a delay between each email? Why?
Anyway there are many forms but the simplest would be to use System.Threading.Thread.Sleep( milliseconds)
|
|
|
|
|
How can i get the name of the Tree Node in Tree View that where check?
|
|
|
|
|
That's easy:
treeView1.SelectedNode.ToString();
Virtual1ty
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Sir, thank you for replying to my question.. .. sir, what im trying to do is to get the name of the tree node that were checked.. how can i get the name of the tree node that where checked?
|
|
|
|
|
The function should return the name of the tree node that was checked.
According to MSDN:
"TreeView.SelectedNode Property
Gets or sets the tree node that is currently selected in the tree view control."
Read about it here[^]
Virtual1ty
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|