|
XmlDocument? DataSet? Both have methods to save your data as XML.
Cheers
I don't like my signature at all
|
|
|
|
|
Roll your own. I generally use XmlDocument.
|
|
|
|
|
If you're familiar with LINQ and you're not restricted to .Net 2.0, then XDocument should rock your XmlDocument world.
Just an irritated, ranting son of ... an IT guy.
At your trolling services
|
|
|
|
|
thank you for your attention
but i am using vs 2005 .net 2.0
thanks anyway
i really love this site with its responsible people
|
|
|
|
|
hi all
i have a mdiChild and i want it to be transparent
but it does not work when i set it`s opacity to 0.2 or any thing else until make it`s parent opacity to 0.2
what should i do to do this without setting the parent opacity?
thanks in advance
|
|
|
|
|
I don't think transparency will work in MDI application.
That may be the only reason for not working the opacity.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
thanks but i rely want to have fade in fade out forms
may i should use forms "none mdichild " but it may take my time and consuming problem any other opinion or advice?
|
|
|
|
|
It is possible to 'contain' one form inside another.
Try this:-
Start a new Windows Forms project, add a button to the default form and attach the following code to the Click event handler.
private void btnForm_Click(object sender, EventArgs e)
{
Form newForm = new Form();
newForm.TopLevel = false;
newForm.Parent = this;
newForm.Visible = true;
newForm.Location = new Point(10, 10);
newForm.Size = new Size(this.ClientSize.Width - 20, this.ClientSize.Height - this.panel1.Height - 20);
newForm.BackColor = Color.Bisque;
newForm.FormBorderStyle = FormBorderStyle.None;
newForm.Dock = DockStyle.Left;
this.Controls.Add(newForm);
}
you will find that newForm is contained within the default form.
I have not tried it, but I'm pretty sure that you could alter the opacity of newForm .
How effective this will be as a solution in your case will depend on how much of the MDI goodness you need to use. It could involve a lot of code - tracking child forms, which has focus etc. etc. etc.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
I want to read file the colluction and add it in dictionary with key and value ,C#
thanks.
|
|
|
|
|
I want to fill in dictionary from table C#
thank you for your idea .
|
|
|
|
|
toto_2010 wrote: I want to read file the colluction and add it in dictionary with key and value ,C#
You have my permission, but only for the remainder of the day
Your task can be divided into three smaller tasks;
- Create a dictionary
- Load a table from a database
- Add items from the table to the dictionary
Is there any specific problem you are running into?
I are Troll
|
|
|
|
|
Hello,
i have a little problem with my application. I'll try to describe as simple and organised as I can.
Objective:
I have two user controls in my main form. I've linked them with a simple line that updates (refresh the form) when one of the user controls was moved.
I want the user of my application to move (with the mouse) one of the user controls, that I've created, in the main form.
The user controls are added directly to the main form like this: this.Control.Add(uc1); .
Problem:
The problem is when the user move one of the user controls.
The refresh/redraw of the form loses the line partialy or absolute. Sometimes the line is visible, sometimes it isn't.
I have NO PROBLEM with the algorithm. It's a simple 2D line. I draw the line in the Paint event of the main form.
Observations:
1. I've tryed to draw on a panel, the result was the same.
2. I've tryed setting the DoubleBuffered property to TRUE, the result was the same.
3. I've observe that pictureBox control donsen't have this problem. I've tested with a simple "line tracking the mouse" application and seen that there is no problem when redrawing.
So my next question was:
- Can I draw/use/add an user control on a pictureBox control? or a better way to draw GDI+ on Windows Forms to get rid of this redrawing problem?
I've tryed to add the user controls in the pictureBox control but they didn't appear.
Thank you!
Alex M.
|
|
|
|
|
Try adding Control.Parent.Invalidate() when you move your control. That way the line should be re-drawn.
You can't add the controls to a PictureBox - it isn't a container and doesn't know what to do with them.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Thank you for you're quick reply!
I've read about pictureBox and see that isn't a container. So it was a foolish from me to try adding a user control to a pictureBox control.
I've tryed to Refresh()/Invalidate() + Update() method(s) when I move one of the user control, but the result is still the same.
To be more clear, see my code:
DesenTabel t1, t2;
private void AddUserControls()
{
t1 = new DesenTabel();
t2 = new DesenTabel();
this.Controls.Add(t1);
this.Controls.Add(t2);
}
private void Form_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Black)), t1.Location, t2.Location);
}
private void t1_Move(object sender, EventArgs e)
{
this.Invalidate();
this.Update();
}
private void t2_Move(object sender, EventArgs e)
{
this.Invalidate();
this.Update();
}
The line isn't drawing well. It intrerupts on the way of linking the two tables because of the redraw!
How can I get rid of this problem ?
Thank you!
Alex M.
|
|
|
|
|
private void AddUserControls()
{
t1 = new DesenTabel();
t2 = new DesenTabel();
this.Controls.Add(t1);
this.Controls.Add(t2);
} Is your problem: add
t1.Move += new EventHandler(node_Move);
t2.Move += new EventHandler(node_Move);
...
void node_Move(object sender, EventArgs e)
{
Invalidate();
} to tie the Move event to the handlers...
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
I've debugged my application and the events are working fine. The move event for re-drawing is triggered.
I've modifyed and simplyfied the AddUserControls method to be more clear to you. The events exists! My mistake for not showing that.
Probably I need to make a canvas to add custom shapes and controls on it, but I still hope this isn't the answer
Thank you!
|
|
|
|
|
Usually, it makes more sense to create a line control. or use VisualBasic PowerPack to add a LineShape. Or the best of all, draw all on a canvas.
What OriginalGriff suggested will work but will have too much flickering. Also, the line will only be drawn when you have finished moving the control.
Atleast my experience has been troublesome so far.
|
|
|
|
|
Hi,
i'll try drawing all to a canvas, in order to make all go nice and well. I'll bring back news!
Cheer's!
Alex M.
|
|
|
|
|
Alex Manolescu wrote: I'll bring back news!
All the best.
|
|
|
|
|
how to fill a standard list dictionary <> from a text file????
Dictionary<int, Customer> customers = new Dictionary<int, Customer>();
Customer cust1 = new Customer();
customers.Add(cust1.ID, cust1);
customers.Add(cust2.ID, cust1);
customers.Add(cust3.ID, cust1);
and what is the other command to read and write in a small file size to share filestream????
|
|
|
|
|
membre123 wrote: how to fill a standard list dictionary <> from a text file????
You will need to parse your text file to get a key value pair and then add them to your dictionary.
Using an xml file for this might actually be better than a text file.
To read and write a file, you should go to msdn.
|
|
|
|
|
thank you for your answer, if you can give me a quick example to analyze the file, and thank you, please I really need it
|
|
|
|
|
You will need to write your own logic for this (once you decide on the structure of your text file).
|
|
|
|
|
membre123 wrote: how to fill a standard list dictionary <> from a text file????
Here's a little sample - it has no error handling or anything nice about it.
using System;
using System.Collections.Generic;
using System.IO;
namespace ConsoleApplication1
{
class Customer
{
public int ID;
public string name;
}
class Program
{
static void Main(string[] args)
{
var Customers = new Dictionary<int, Customer>();
using (StreamReader fs = new StreamReader(@"C:\Stuff\theInputFile.txt"))
{
string dataLine;
while ((dataLine = fs.ReadLine()) != null)
{
string[] s = dataLine.Split(',');
int id = int.Parse(s[0]);
Customer c = new Customer();
c.ID = id;
c.name = s[1].Trim();
Customers.Add(c.ID, c);
}
}
foreach (var item in Customers)
{
Console.WriteLine("ID: {0} Customer {1}", item.Key, item.Value.name );
}
Console.ReadLine();
}
}
}
What you have to do depends entirely on the declaration for Customer and the layout of the input file.
My input file looks like this:
1, Jet Black
2, Hugh Cornwell
3, Joe Strummer
4, Sid Vicious
membre123 wrote: and what is the other command to read and write in a small file size to share filestream????
I don't know what this means.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|