|
|
Change the Opacity property of your form in a timer or something like that.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
it doesn't work!
the interval property of timer is 100!
this is my code,is there anything wrong?
private void button1_Click(object sender, System.EventArgs e)
{
this.Opacity = 0;
timer1.Start();
}
private void timer1_Tick(object sender, System.EventArgs e)
{
this.Opacity = this.Opacity + 5;
if(this.Opacity >= 100)
{
timer1.Stop();
}
}
Tuliplanet
|
|
|
|
|
Hey.. You have to set the timers interval, when it has to run the method.
Timer newTimer = new Timer();<br />
newTimer.Interval = 1000;
newTimer.Tick += new EventHandler(TheMethod);<br />
<br />
<br />
newTimer.Start();
- Up The Irons, Morten Kristensen
|
|
|
|
|
|
By the way this will solve it:
Tuliplanet wrote:
this.Opacity = this.Opacity + 5;
Change it to
this.Opacity = this.Opacity + 0.05;
You should use numbers between 0 to 1.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
see my reply!!
i set interval=100,but the form just show after a flash!
Tuliplanet
|
|
|
|
|
Hehe.. Easy man. Didnt see that sorry.
Anyways.. You could also use Thread and ThreadStart?
<br />
using System.Threading;<br />
<br />
<br />
ThreadStart ts = new ThreadStart(TheMethod);<br />
Thread t = new Thread(ts);<br />
t.Start();<br />
<br />
<br />
public void TheMethod(){<br />
for(int i = 0;i<=100;i++){<br />
Thread.Sleep(10);<br />
}<br />
}<br />
- Up The Irons, Morten Kristensen
|
|
|
|
|
The problem is not with thread or timer. He set the wrong value for that property.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
I have a xml document with utf-8 encoding and tags name is on cyrilic. I can't use XPath to find a tag. What can I do?
10x in advance
|
|
|
|
|
What do you mean by I can't use XPath? You get error you don't know the proper query string? There are many samples article about XPath in this site and some thers in MSDN too. Have you take a look at them?
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
I'm using KBDLLHOOKSTRUCT.vkCode and need to get char
|
|
|
|
|
You should just be able to cast it to a char :
char c = (char)theStruct.vkCode;
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Point p = new Point(12, 14);
....
p.X = 13;
p.Offset(1, 0);
p = new Point(13, 14);
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Are you sure you're typing an upper-case X and not a lower-case x ? The latter is a private field and thus only accessible from the Point struct itself. Assigning the former (upper-case X ) is fine.
Also keep in mind that the Point struct (like all structs) is a value type. If you think you have a reference to it somewhere else and you didn't pass it using the ref keyword, then you're mistaken. If you pass Point as a param you pass a copy, not a reference. If you're expecting Offset to change that, it won't. Otherwise, it does modify the instance of the Point on which it was called.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
First of all, there is no "global" anything in .NET. If doesn't matter if these ArrayList s are instance or static members, the problem is that the Point struct is a value type and a statement such as
((Point)myArrList[i]).X = 13; is actually compiled to something similar to this
Point p = (Point)myArrList[i];
p.X = 13; Either way, therein lies the problem. Since the Point struct is a value type, you're actually making a copy of it (in p in this example), not assigning a reference to it. This is how value types work. It doesn't matter if you pass them as parameters or store them in a list. When you get them from the list you are getting a copy so the value type in the list will not be changed.
See the article, Value vs Reference Types in C#[^] (actually, all of .NET) for a comprehensive discussion of the topic.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
I just read the article, it was really informative...
But now there is a very big question in my mind:
Where should I store my Point structs so that be able to change their X and Y properties later, without requiring to reNEW them?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
You don't have to re-instantiate them, only re-add them to the ArrayList (or collection, or class member, etc.):
Point p = myArrList[i];
p.X = 13;
myArrList[i] = p;
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
somebodys can help me, how to use AxMediaPlayer to play any mp3 file on Internet.
thanks
Nho'c Ti`
|
|
|
|
|
Set the URL to a URL like http://host.domain.tld/dir/file.mp3. Download the Windows Media Player SDK[^] for nearly completely API documentation.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi, I need to use a form control but without the round-edged windows title bar. Does anyone know how to get rid of the title bar. Anyway, I'm using C# in this Windows application. Thanks.
|
|
|
|
|
Set the ControlBox property to False and the Text property to blank.
|
|
|
|
|
You can also set Form.FormBorderStyle to FormBorderStyle.None .
Microsoft MVP, Visual C#
My Articles
|
|
|
|