|
You can place a string in a control. Either you assign the string to the Text or Caption property of the control, or of a Label that you add as a child control. To set the font of the text displayed, you change the Font property of the control where you put the string.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
hi,
can any body provide me with some help regarding the addition of a horizontal seperator in the context menu for .NET 1.1.
thanks in advance,
regards.
|
|
|
|
|
In the context menu designer, put a hyphen (-) in as the caption. This will be displayed as a separator.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello frenz,
In my application, I need to recreate & save an xml file frequently in a thread.
I use the Save() of the XmlDocument class to do this.
But at times, when I try to save the file, I get an WIn32IOError exception saying that the file is being used by another process..
Is it possible to check whether the file is being used by another program before saving?
If it is being used by another process, I need my application to wait until the resource is released to rewrite it.
Advance thanks for the help.
|
|
|
|
|
Try this..
File.GetLastAccessTime(@"C:\time.txt"); It will give last access time of the given file. If it is say within some given time limit, you can check it and then wait using Thread.Sleep().. and then continue..
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
u can use this logic as well
DateTime StartTime = DateTime.Now;<br />
while(true)<br />
{<br />
try<br />
{<br />
}<br />
catch<br />
{<br />
if(StartTime.AddSeconds(timeouttime) > DateTime.Now)<br />
{<br />
break;<br />
}<br />
System.Threading.Thread.Sleep(sleeptime);<br />
continue;<br />
}<br />
break;<br />
}
Regards
Shajeel
|
|
|
|
|
|
Hi all
Any good book about Xml Begenner
SAS
|
|
|
|
|
Xml for C#, or are you in the wrong forum ? What do you need to know ? Have you read the w3 schools site, or done a general google ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
... A 100KB file in a 1-dimensional array, byte by byte?
|
|
|
|
|
There should be no problem at all
Luc Pattyn
|
|
|
|
|
Why do it byte by byte? There is a method that creates the array for you and reads the file into it. Check out the File.ReadAllBytes method.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
I have a form that picks a color and then returns it to the main form. it is then supposed to fade to that color. I have tried using a loop and have tried:
Form1 ReplacementForm = new Form1();
ReplacementForm.Opacity = 0;
ReplacementForm.splitContainer1.BackColor = Properties.Settings.Default.BackGroundColor;
...
ReplacementForm.splitContainer1.Panel2.BackColor = Properties.Settings.Default.BackGroundColor;
ReplacementForm.Opacity = .5;
Thread.Sleep(50);
ReplacementForm.Opacity = .10;
Thread.Sleep(50);
ReplacementForm.Opacity = .15;
Thread.Sleep(50);
...
ReplacementForm.Opacity = .90;
Thread.Sleep(50);
ReplacementForm.Opacity = .95;
Thread.Sleep(50);
ReplacementForm.Opacity = 1;
Thread.Sleep(50);
splitContainer1.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer2.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer3.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer4.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer1.Panel1.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer1.Panel2.BackColor = Properties.Settings.Default.BackGroundColor;
ReplacementForm.Close();
Neither have worked. Why? what do i have to do to get it to fade from one color to the other? I don't care if it doesn't literally fade colors, as long as it looks like it does.
Thanks in advance.
|
|
|
|
|
Thread.Sleep should always be a last resort. Instead, work out a smooth path from the old color to the new, and set the color incrementally using a timer.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You had asked the same question some time back. Did you try the suggestions given by the users? Link[^]
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
Oops. I'm sorry. I have short-term memory loss.
|
|
|
|
|
I'm trying to find a way to embed various Windows Forms controls (like TextBox, Label, etc.) INSIDE a tree-like control. I'm trying to create something that looks like the Properties window inside the Visual Studio IDE for C# or C++. For example, when you look at the properties for a Button control you see the word Font with a "+" sign next to it. When you click on the "+" sign, it expands to show several font-related rows that each contain a Label column and a TextBox column.
Does anyone know if this is possible? Can it be done without creating a custom control? If it requires a custom control, how would I go about creating it?
Any help is greatly appreciated!
Thanks,
Stephanie
|
|
|
|
|
Have a look at TreeListView[^] control
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
Hi, I am having a kind of weird problem in my apps.
When I Show a dialog in my app I generally call it like this
using(Dialogs.dlgSomeDialog dialog = new Dialogs.dlgSomeDialog())
{
// do any setup processing here
// show the dialog to the user
dialog.ShowDialog(this);
}
Now the problem I am having is when I close the dialog using the exit button, which just updates any public fields of the dialog form and then
calls this.Hide();, the main form goes to the back of the desktop. So if any other appliations are open, my app goes behind them. Any idea why this happens.
"All of us who served in one war or another know very well that all wars are the glory and the agony of the young."
Gerald Ford
|
|
|
|
|
I call my dialogs a little different, but i don't really see why that would make much of a difference.
As a fix, before you hide the child form, make the parent always on top, then turn off always on top once its hidden. Unless once you turn it off it goes straight to the back again anyways.
Incase you want to try i call my dialogs thusly:
Form2 whatev = new Form2();
whatev.ShowDialog();
Its pretty much the same thing of course but, who knows.
Computers secretly laugh at us y'know
|
|
|
|
|
First thanks for you reply, I have implemented the TopMost Property as a result. I used to call my dialogs this way
Dialogs.dlg dialog = new Dialogs.dlg
dlg.ShowDialog(this);
if(!dlg.IsDisposed)
dlg.Dispose();
dlg = null;
Either way I still have this problem. I am testing the TopMost trick and see if it works. Again Thanks for your reply.
Sautin.
"All of us who served in one war or another know very well that all wars are the glory and the agony of the young."
Gerald Ford
|
|
|
|
|
Hi everyone
I have generated a 2D array (like a matrix) which is rather large and I want to find som simple way to display it in e.g a datagrid. Is there anyone how can tell me how this is done. I have seen the examples on the net, but they only show how you can do this for a simple array...
Thanks in advance
AL
|
|
|
|
|
|
hi
i have a table in my sqlServer 2005 database that it's type is nvarchar, and when i insert a record to table with persian language (Farsi), it show them like "???????"
i insert a record directly to my sql table and show it's content correctly but when i insert to it from code, it show as "??????".
how to solve my problem ?
thanks.
|
|
|
|
|
Is it possible to assign a range to a case statement? If not, is there a different way to accomplish the same thing?
For example:
Switch (int x)<br />
{<br />
Case 0 to 5:<br />
Case 6 to 10:<br />
Case 11 to 15:<br />
Default:<br />
}
Thanks!
David Wilkes
|
|
|
|