|
You don't need a tutorial. It's very simple.
1. Add a ColorDialog control to your form (System.Windows.Forms.ColorDialog)
2. Add a button and _Click event for the button.
3. Add the following code.
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
this.colorDialog1.ShowDialog(this);<br />
this.BackColor = this.colorDialog1.Color;<br />
}<br />
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
Basically you're right, it's just better style to query the dialog return value:
<br />
if (colorDialog1.ShowDialog(this) == DialogResult.OK)<br />
{<br />
this.BackColor = colorDialog1.Color;<br />
}<br />
mav
|
|
|
|
|
Thanks. I feel like an idiot now that I couldn't find that that.
|
|
|
|
|
I have an app written in C# that is currently calling some DLL's written in FORTRAN. I have a web-based Flash frontend. All very exciting.
I have been asked to port the entire system to run on Solaris 8.
A few details:
FORTRAN is required for intense number crunching.
Solaris will run on SPARC processors.
Does anyone have any experience doing anything like this?
My initial thoughts were to investigate Mono and Java. Mono may be fine, yet I don't know anything about integrating with FORTRAN code at that point. Java is not something I'm super comfortable with in terms of building an enterprise-level app, but I guess a young dog may have to learn new tircks.
Thanks in advance for any suggestions. ;);P
|
|
|
|
|
Larsenal wrote:
I have an app written in C# that is currently calling some DLL's written in FORTRAN. I have a web-based Flash frontend. All very exciting.
I don't know the answer to your question... but I have one myself, if everything works fine, and it's a big "enterprise-level" app, why bother porting it?
Isn't there another solution?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
That's a great question. Answer: new client REQUIRES it to run within their current server architecture.
So sad... I know.
|
|
|
|
|
Is there such a thing in C#?
I know of the internal class modifier, but I want to grant "friend"-like access to a particular class from a different assembly. The reasons why I need this are long an involved, and the company I work for won't budge on the issue, so I need to find a way to make this work.
Any ideas?
Thanks.
|
|
|
|
|
Not possible with top-level types in C#. There is no real eqivalent to c++ friend access level.
Your only alternative would be to derive the class that needs access from a puplic top level class that contains the class you want to access as a protected or protected internal class, which is a kludge that sort of defeats the pupose of not making the class you need access to public in the first place.
What is your employer REALLY trying to accomplish here? Do you need access to the entire class, or just a few methods? Do you need to instantiate the class in the other assembly?
Would a public wrapper class containing an instance the 'protected' class and exposing only the desired methods suffice (i.e. a facade)?- expose the facade class via a public class factory...
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
I'm not sure what the attribute is right now, but there is a way to make objects callable only from specified assemblies. If ur calling object is managed and u can place it in an isolated assembly then u can reach the solution u are looking for.
|
|
|
|
|
Apparently, VS2005 has a new attribute
[VisibleFromAssembly="ASSEMBLY_NAME"] which I'll be able to use.
I'm not sure that's the exact attribute name, but it's something similar that can be applied at the class level, for instance, to an internal class.
|
|
|
|
|
How can I Insert the values in the text in the nodes of the Treeview?
|
|
|
|
|
Try checking out the documentation for TreeView.Nodes.Add(string)[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have created a propertygrid and a dialog form in Windows Form.
How can I make my dialog form pop up when i click on the attribute of my PropertyGrid?
Can first give a reference site where i can find out the answer cause it is quite urgent.Preferably an executable program..
Deadline approaching... Please help...
Thank you
|
|
|
|
|
Searching about EditorAttribute .. you will find your solution.
And you might need this as well TypeConverterAttribute.
Hope this help
|
|
|
|
|
I have manage to make my PropertyGrid pop up Font form from the System.Windows.Drawing but no luck with my own defined form class, i try to make it pop up like the Font, intead it select all the Windows.Form properties inside my PropertyGrid.
Please help!!!
|
|
|
|
|
I am trying to create a timer that will pause the program for 1.5 seconds. I need something that pauses but does not stop the Thread.
In a nutshell, here is what I am doing. I have two cards that appear on the screen. I want them to stay there for 1.5 seconds and then re-draw back to a default value.
I have tried the Thread.Sleep but that pauses the entire program and prevents the one card from displaying at all (even though the sleep is called after the line to display the card).
Any help would be appreciated.
|
|
|
|
|
Monitor.Wait(new Timespan())
|
|
|
|
|
Can you be more specific. I can't get that to work either.
Here is the code I have tried using:
private void P1Flip_Click(object sender, System.EventArgs e)
{
GetCard(1);
Player1Card = P1Card.GetCardNum();
Invalidate();
P1CardPlayed = true;
P1Flip.Enabled = false;
if (P1CardPlayed && P2CardPlayed)
{
PlayGame();
if ((winner == 1) || (winner == 2))
{
Threading.Thread.Sleep(WaitTime);
Player1Card = 67;
Player2Card = 67;
UpdateCardsLeft();
P1CardPlayed = false;
P2CardPlayed = false;
P1Flip.Enabled = true;
P2Flip.Enabled = true;
}
else
{
ShowWarMessage();
P1War.Enabled = true;
P2War.Enabled = true;
P1CardPlayed = false;
P2CardPlayed = false;
}
}
}
My problem is even though the Threading.Thread.Sleep(WaitTime) is after the Invalidate() command, the screen is not re-drawing until after the WaitTime? This is driving me nuts.
|
|
|
|
|
Bob Bonser wrote:
My problem is even though the Threading.Thread.Sleep(WaitTime) is after the Invalidate() command, the screen is not re-drawing until after the WaitTime? This is driving me nuts.
Try throwing a Application.DoEvents(); in just before you put the thread to sleep. This will give the window the opportunity to respond to the WM_PAINT message it's about to receive.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi
i want to zip a file or folder at runtime . is there a command for running to zip a folder in windows ? ( i have win XP so i think must there is a command for this work )
Regards' Amir jalaly
|
|
|
|
|
Although XP has the ability to READ zip files and display them like they were directories, I don't beleive it has the ability to create them. There are a number of open source librarys like this one[^] that provide some zip creation support.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Rob Graham wrote:
I don't beleive it has the ability to create them
You might be happy to try...
Right click File or Folder.
Send To -> Compressed (zipped) Folder
|
|
|
|
|
That makes a compressed NTFS folder, not a zip file....
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Is this information incorrect then?
http://www.windowsnetworking.com/kbase/WindowsTips/WindowsXP/UserTips/Miscellaneous/CompressedZippedversusCompressionFoldersinXP.html
The article says that MSFT has used code based on WinZip7.
|
|
|
|