|
try this link.
http://www.thescripts.com/forum/thread225413.html
|
|
|
|
|
thakx but i was the same answer on google.
but its really thankx for your reply
one more thing can you answer me
how to some the number in crystal report?
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
hi, i have a question. imagine i have a window form and in it i have a panel. now, i need to do a mousedown on the form and then mouseup in the panel. The idea here is to create a drag and drop action. However, the by creating those events, it does not seem to work because the mouseup event is never called although i click on the mouse on the form and then hold and finally release in the panel area.
What events should i use since this can''t work?
Thanks in advance.
|
|
|
|
|
Why don't you just use the drag & drop functionality a form already supports.. It will save you a lot of headache!
|
|
|
|
|
Hello,
The trick is to handle the MouseUp from the form as well, and check if the Cursor is in the Panel range.
Point pt = yourPanel.PointToClient(Cursor.Position);
Rectangle rc = yourPanel.ClientRectangle;
if (rc.Contains(pt))
{
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi,
I am creating a developing screensaver in C#. I have done everything to create screensaver. Now I am stuck in a problem. How to create a scr file ? I have renamed the exe to scr. However, if I right click the scr file and select the install option, my antivirus prompts a suspicious activity. Any help on this ?
Thanks,
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup
|
|
|
|
|
Identity Undisclosed wrote: How to create a scr file ? I have renamed the exe to scr
That's it!
Identity Undisclosed wrote: However, if I right click the scr file and select the install opti
You don't need to install it!
Just copy it in the "Windows" directory.
All the best,
Martin
|
|
|
|
|
Hi!
Is there some way to get the same color of the GroupBox Heading and put it on a Label? The color is different depending on which Xp theme you are using.
/Mjelten
|
|
|
|
|
Enumeration System.Drawing.KnownColors contains all of the system defined colours. The Groupbox heading will be one of these - but you'd probably need to experiment to work out which one.
|
|
|
|
|
Ok, thanks but how do get access to the color
I can not set label1.ForeColor = System.Drawing.KnownColor.something
error: Cannot implicitly convert type 'System.Drawing.KnownColor' to 'System.Drawing.Color'
|
|
|
|
|
Hello,
The Color class provides the static FromKnownColor[^] method.
label1.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.something);
All the best,
Martin
|
|
|
|
|
Or you could use the SystemColors class.
Either way, you should seriously consider using MSDN. Sometimes, reading the manual can actually help.
|
|
|
|
|
|
Then you have to use visual styles stuff to get the answer:-
using System.Windows.Forms.VisualStyles;
....
VisualStyleRenderer vr = new VisualStyleRenderer( VisualStyleElement.Button.GroupBox.Normal);
Color cr = vr.GetColor(ColorProperty.TextColor);
|
|
|
|
|
Thank you! Been working with this for a long time... Perfect solution!
|
|
|
|
|
I have created a thread and I want to change the title of my window from that new thread, but I get exception with message "accessed from a thread other than the thread it was created on."
Any solution?
agha.khan@hotmail.com
Agha Khan
|
|
|
|
|
You have to use deletegates. To use it you must declare a void method that accepts a string as a input parameter, and a delegate with the same parameters and return.
Then, when you want change the text you must create the previous created delegate and pass the method name as parameter. Then you call form's "Invoke" with the delegate the string (inside of an array of objects) if Invoking is required.
protected delegate void ChangeFormTextCallback(string pText);<br />
<br />
public void ChangeFormText(string pText)<br />
{<br />
this.Text = pText;<br />
}<br />
<br />
<br />
...<br />
<br />
ChangeFormTextCallback oCllBack = new ChangeFormTextCallback(ChangeFormText);<br />
if (this.InvokeRequired)<br />
{<br />
this.Invoke(oCllBack , new object[] {"New Text"});<br />
}<br />
else<br />
voControl.Text = vsTexto;<br />
...
|
|
|
|
|
Thank you. It works very well.
Best regards
Agha Khan;P
|
|
|
|
|
just to add, if you are using multi threaded windows applications it is good practice to do this whenever updating the screen. it forces the method to be called on the main thread, which is marked in you app by the tag [STAThread].
|
|
|
|
|
I´m trying to dynamically load and unload assembly. The load part works just fine, but there are some problems with the unload part. It seems that the calling assembly didn´t release the dynamically loaded assembly, because I can´t recompile it.
Here is sample of my code:
AppDomain ad = AppDomain.CreateDomain("TestDomain");
Assembly a = ad.Load(Assembly.LoadFile(@"D:\Test.dll").GetName());
.
.
some code
.
.
AppDomain.Unload(ad);
Can anyone help me with this?
cellardoor
|
|
|
|
|
Did your app really exit ? or does it still show in Task Manager ? (probably because one
of its foreground threads did not finish, because it isnt done yet, or you forgot to make
it a background thread).
|
|
|
|
|
Hello All,
I am trying to call a method through thread . it is working if the method does not contain any parameter, if it has got a parameter then it will pop up error stating that method name expected.
Am i missing something here to perform this action.
Thanks
Bharath.S Ron
|
|
|
|
|
you need to use the ParameterizedThreadStart delegate which is part of the Threading namespace in .NET 2.0.
i.e
public void RunThread()
{
int parameter = 20;
Thread t = new Thread(new ParameterizedThreadStart(SampleMethodWithParameters));
t.Start(parameter);
}
private void SampleMethodWithParameters(object parameter)
{
for(int index = 0; index < Convert.ToInt32(parameter); index++)
{
Console.WriteLine("HelloWorld " + index.ToString());
Thread.Sleep(1000);
}
}</code>
edit:
no idea why my half my FOR loop is being displayed but hopefully that should give you an idea.
-- modified at 3:28 Wednesday 25th July, 2007
|
|
|
|
|
thank you very much
Bharath.S Ron
|
|
|
|
|
Hi All,
In my C # Console application I have app.config file for all configaration options. So, The source file name & location(Ex:c:\foldername.abc.csv) and destination file name & location(Ex:c:\foldername.abc.txt) have to configure in app.config file.
Thank in Advance.
Waiting for reply.
~Liyakhat.
|
|
|
|