|
Thankyou very much
That is exactly what I needed, I am now inundated with a myriad of dynamic pie charts
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
hi
Can anyOne send me the source code of Flow Diagram or like this software.
Flow Diagram is a softWare that we used it for drawing flowchart or other like DFD or ERD Diagrams.
Best Regards
Alireza Meshkin
|
|
|
|
|
Sure - I've got some under the desk here.....
Actually, I believe there is a free library that does this kicking around. But this forum is really for programmers, not people looking for freebies, so you'll have to google it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I'm struggeling a bit here.
I'm trying to save a TreeView and all of it's nodes as shown in the code belowe:
xw.WriteStartElement("TreeView");
foreach(TreeNode tn in theTreeView.Nodes)
{
xw.WriteStartElement("TreeNode");
xw.WriteAttributeString("Text", tn.Text);
if(theNode.Parent == null)
{
xw.WriteAttributeString("Parent", "null");
foreach(TreeNode n in tn.Nodes)
{
xw.WriteStartElement("TreeNode");
xw.WriteAttributeString("Text", n.Text);
xw.WriteAttributeString("Parent", n.Parent.ToString());
xw.WriteEndElement();
}
}
xw.WriteEndElement();
}
xw.WriteEndElement();
The xml file looks something like this:
<treeview>
- <treenode text="Startnode" parent="null">
<treenode text="Node0" parent="TreeNode: Startnode">
<treenode text="Node3" parent="TreeNode: Startnode">
<treenode text="Node4" parent="TreeNode: Startnode">
- <treenode text="Node5" parent="null">
<treenode text="Node6" parent="TreeNode: Node5">
The problem is that I only get the first nodes and the second nodes in the TreeView hirarki. If I continue to add a foreach(TreeNode n in theNode.Nodes) I will end up writing it forever...
Is there a better way of getting all the nodes in the TreeView than
foreach(TreeNode n in tn.Nodes)?
or what must I do?
Thanks in advance for your help ,
Thomas
|
|
|
|
|
You have heard of recursion, right?
private const string xmlns = "urn:myTree";
private const string prefix = "t";
public void WriteToXml(TreeView view)
{
XmlTextWriter writer = new XmlTextWriter("somefile.xml", Encoding.UTF8);
writer.WriteStartDocument();
writer.WriteStartElement(prefix, "treeView", xmlns);
foreach (TreeNode node in view.Nodes)
this.WriteToXmlHelper(node, writer);
writer.WriteEndElement();
writer.WriteEndDocument();
}
private void WriteToXmlHelper(TreeNode node, XmlTextWriter writer)
{
writer.WriteStartElement(prefix, "treeNode", xmlns);
writer.WriteStartAttribute(prefix, "text", xmlns);
writer.WriteString(node.Text);
writer.WriteEndAttribute();
foreach (TreeNode node in node.Nodes)
this.WriteToXmlHelper(node, writer);
writer.WriteEndElement();
} Recursion is the best way of handling hierarchical data. This example also writes out a hierarchical XML structure which is easier to resolve then following IDREFs and what not (since it looks like you're venturing down that road).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
Does anyone know of a good XML Comment documentation tool that allows custom xml elements. I am looking to include things like history information (you know author, date/time, reason). I've looked at NDoc which produces great output but doesn't seem to handle custom XML elements and is full of bugs.
Regards,
Colin.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
The most popular free tool is NDoc, which yours truly also works on. (And I'm not just saying it's the most popular because I do work on it - look at the companies that use it!)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
is it possible to customise the default MS date time picker control so that it will only allow you to pick :
1) Month & Year
2) Just year
I know this could easily be done with combo boxes etc, but it would be nice to be able to do this directly through the pickers
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
First, changing the DateTimePicker to only allow these things either drastically cuts down on the user interface - thereby making the control unnecessary bloat - or pisses off the user because they think they can select a date but only the month and year are used. From a UI perspective, this is a bad thing.
Now, while you can't change the UI in that way (other than overriding WndProc and attempting to use windows messages and notifications to do so), you can specify a custom format that the textbox portion of the DateTimePicker displays with the CustomFormat or Format property. This way, at least the user has some idea that only the month and / or year is valid.
When you get the Value (a DateTime structure), just grab the month and / or year and forget the rest.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
In the end I have opted for combo boxes.
The reason being is that I wanted to restrict the visuallity of the pickers so that on drop down they only showed Year or Month/Year. This would have also bypassed the problem of the user knowing that the particular picker will only allow them to choose a Year or Month/Year.
It would have been feasible to use the pickers as they are and just pull the necessary data from the resulting value, but this would mean problems for the user when selecting wildly different dates (i.e. if March 1953 is currently selected, it would take a while to get to April 2005 - now they could type the value, but that defeats the point of a picker)
After much fiddling, and your comments, it is obvious that combo boxes are the best way to go.
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
How can I convert a string to System.Drawing.Color?
I'm saving a color in a xml file:
xw.WriteAttributeString("BackColor", theButton.BackColor.ToString());
The file contains:
BackColor="Color [A=255, R=255, G=255, B=0]"
or
BackColor="Color[Black]"
I then read it back:
strColor = reader.Value;
Thanks in advance for your help ,
Thomas
|
|
|
|
|
thomasa wrote:
How can I convert a string to System.Drawing.Color?
For named colors: Color.FromName
Of course for the other you will have parse the colors and push them in via Color.FromArgb
Rocky <><
www.GotTheAnswerToSpam.com
|
|
|
|
|
Given:
System.Drawing.Color obj;
string name;
Color to String:
name = obj.ToString();
String to Object:
obj = System.Drawing.Color.FromName(name);
|
|
|
|
|
I've built my Windows Form application with form's localizable property set to true, then configure support for different languages by setting Language property to fr, fr-CA, fr-fr, de, en, en-US, en-UK. I checked, the satellite assemblies were all there in the right subfolders after I compiled the application.
I execute the application on my machine, and since it's a "en-us" machine, I get the corresponding UI elements displayed with the corresponding english labels.
But, how can I change the CurrentUICulture of my "machine" - so I can see what the GUI looks like under different machine culture setting? I tried Control Panel>Regional and Language Options. I changed settings on "Regional Options" tab, but nothing I did seems to affect how my application chooses its satellite assembly: It always chooses "en-US" despite of the changes???
Thanks in advance.
|
|
|
|
|
Changing the regional settings - unless you have the appropriate MUI packs for the version of Windows you're running (only on 2000 and XP currently, I believe) - doesn't change your language.
Instead, you need to provide a way to change it in your application. If you make a user preference to do this, you have to reset the controls based on the localization information in the satellite assembly. You don't have to re-instantiate the controls or add the controls to their would-be parent's Controls collection, but you do have to do practically everything else.
An easier way would be to add a key/value pair (say, "language", then the 5-digit lang-culture pair as the value) to your <appSettings> . In your application - either as the first lines in the main forms's constructor, or before you call Application.Run - read the setting with ConfigurationSettings.AppSettings["language"] . If a setting exists, set Thread.CurrentUICulture = new Culture(myLangSetting) . Any other threads that are spawned from the main thread (which the UI must add, remove, and usually update controls on) should inherit the setting from the thread that spawned them.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks, I can see what you're getting at. I'll just put a Dropdown box and let user to select CurrentUICulture.
|
|
|
|
|
Actually, I think you missed my point. If you use a drop-down, this implies that you're UI is already running (unless you use a modal dialog before calling Application.Run , which can be tricky depending on a number of factors). If you do this, to change the UI culture you have to completely reset EVERY SINGLE CONTROL in your application. This is especially tedious when you have multiple forms. Switching languages while a program is running - especially larger programs - is definitely not a trivial thing.
If users require different languages on their Windows machine, then they might just have the appropriate MUI pack installed and enabled. They will see the appropriate localized UI automatically. If you just require this for testing, use the config file. If nothing else, companies that require a different localized UI can change the config file when - for native applications - they would change the registry (using the registry for .NET apps is not recommended). It's not like users are going to be changing the UI culture often, right? Why make it much more difficult on yourself.
That's what I was getting at - keep it simple. Assign the UI Culture before you start your application (which means the main UI thread, which will effect all threads spawned from it). You'll save yourself A LOT of trouble.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
You're right, configure it before loading the application or UI is constructed. Point well taken.
|
|
|
|
|
Hello,
How can i create avi file or any other movie file from a collection of images. I want to know, which dll i can use to buil a movie file.
bye.
|
|
|
|
|
There is nothing in the .NET Framework Base Class Library (BCL) that can do this. You should download Microsoft DirectX 9.0 with the managed classes that will allow you to use C#. Read the docs so that you understand the concepts, which is basically to string readers, decoders, encoders, and writers together. In your case, it's slightly different. You should also search this site because I'm sure I've seen an example or two on this topic.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
Thank u Heath Stewart, let me download Microsoft DirectX 9.0 with the managed classes. Let me also search more this into this site and then i will decide what can i do.
Khurram.
|
|
|
|
|
OK, I have spent hours trying to figure this out on my own. I think I just don't know what the correct terminology is.
I am trying to call a form enter some data and pass that data back to the calling form. I am using a custom form and not a built in dialog.
Can someone point me in the right direction. I can't seem to even find an example on CP, MSDN, or a mayrid of other websites as well as two C# books.
Jeff Patterson
Programmers speak in Code.
http://www.anti-dmca.org[^]
|
|
|
|
|
Jeff,
You should check into delegates, events, and eventargs. You can derive a class from EventArgs from which you can specify whatever values you want to pass. Events allow you to register delegates which are held in some-what of a linked-list fashion which are then invoked when the event fires. There are several good articles available, some which are on CP (check out Chris Sell's article: .NET Delegates: A C# Bedtime Story[^]). Hope this is of some help. Here is just one example of how delegates and events work together:
using System;
using System.Windows.Forms;
namespace Test
{
class Class1 : System.Windows.Forms.Form
{
public Class1(){}
public delegate void MyEventHandler(int i);
public event MyEventHandler MyEvent;
static void Main(string[] args)
{
Class1 cls = new Class1();
cls.MyEvent += new MyEventHandler(SomeMethod);
cls.MyEvent += new MyEventHandler(AnotherMethod);
if(cls.MyEvent != null)
cls.MyEvent(6);
cls.ShowDialog();
}
public static void SomeMethod(int i)
{
MessageBox.Show("Hello from SomeMethod. " +
i + " was passed in.");
}
public static void AnotherMethod(int i)
{
MessageBox.Show("Hello from AnotherMethod. " +
i + " was passed in.");
}
}
}
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
Thanks Nick, I will have to study this a little more indepthly. I read the "Bed Time Story" before I posted this message and it looked like it was more complicated that what I was trying to do. I guess not.
Thanks
Jeff Patterson
Programmers speak in Code.
http://www.anti-dmca.org[^]
|
|
|
|
|
Hi guys,
I am currently implementing an application which needs to support paths like:
%windir%\Microsoft.NET\Framework\
The pointers (eg %windir%) are supported by .NET, so i can access file listings easily.
However, Directory.Exists returns some wierd results:
Directory.Exists("%windir%") => false
Directory.Exists("%windir%\Microsoft.NET\") => true
Does anyone know of a way to validate these directories properly. I can just request a directory listing, and wait for an exception but this isn't good coding and will slow down the process too much as potentially hundreds will need to be evaluated.
Thanks,
Tatham Oddie
Developer, SSW (www.ssw.com.au
|
|
|
|