|
thanks. this is my code now:
private MessageDialog(string text)
{
this.textBox1.Text = text;
}
public static void Show(string text){
new MessageDialog(text).ShowDialog();
}
i guess i could've made my constructor public and done something like
new MessageDialog(text).ShowDialog() from my main application to call it, but i like it better this way
topic can be closed
|
|
|
|
|
Remember to call Close on the form once you're done with it (after calling ShowDialog), otherwise you'd be leaking resources.
|
|
|
|
|
this may be of intrest to you as well.
http://www.codeproject.com/cs/miscctrl/MessageBoxEx.asp?df=100&forumid=155440&noise=2&mpp=50&select=1661227&msg=1661227
|
|
|
|
|
|
Hi,
Im writing a few things to an xml file. But if i repeat this, it removes all previous data in my xml file with new ones.
How can i prevent this? I want the data being appended.
Thanks in advance!
|
|
|
|
|
Your question cannot be answered. Yuor code is overwriting the nodes, or you have some other problem with persistence. We'd have to see the code to know.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
This is my xml class code:
class XMLWriter
{
XmlWriterSettings settings = new XmlWriterSettings();
DateTime dateTimeNow = DateTime.Now;
XmlWriter writer = null;
public XMLWriter()
{
this.settings.Indent = true;
this.settings.IndentChars = "\t";
this.settings.OmitXmlDeclaration = true;
this.settings.NewLineOnAttributes = true;
this.settings.Encoding = Encoding.Default;
this.settings.ConformanceLevel = ConformanceLevel.Fragment;
}
public void WriteStartElement()
{
this.writer = XmlWriter.Create("Testing.xml", settings);
this.writer.WriteStartElement("Information");
this.writer.WriteElementString("DateOfBuilding", dateTimeNow.ToShortDateString());
this.writer.WriteElementString("TimeOfBuilding", dateTimeNow.ToLongTimeString());
}
public void WritingToXMLDoc(string elementString, string writeToXMLDoc)
{
this.writer.WriteElementString(elementString, writeToXMLDoc);
}
public void WriterEndelementString()
{
this.writer.WriteEndElement();
this.writer.Flush();
if (this.writer != null)
this.writer.Close();
}
}
|
|
|
|
|
You won't be able to persist old data in the file when using the XmlWriter . Use XmlDocument and associated classes to deal with this.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
OK, well, this code creates a new XML document every time. You need to abandon this approach and use XMLDocument to load your document if you want to insert nodes into an existing document.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
Thank you guys!
I'll try that!
|
|
|
|
|
Hi gurus,
As the subject says, I'd like to know how I can convert and manipulate 15bits encoded colors to 24bits encoded colors?
For example 0x7fff is white...
Can any one show me a piece of code please?
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
Well, you really just want to shift each value by 9 bits, so 0x7FFF << 9 is going to be 0xFFF700, which is the best you can do.
I've never heard of 15 bit color ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
he probably means 16 bit... (I hope )
|
|
|
|
|
Is 0x7FFF 16 bit white ? I didn't think so.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
no, it isn't. but 0x7FFF is 16 bit no?
|
|
|
|
|
If the first bit is a 0, yes. 0xFFFF is 16 bit white.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: I've never heard of 15 bit color ?
You cant be serious?
|
|
|
|
|
Yeah, I am. What uses 15 bit ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
OK - so it actually packs 15 bits side by side ? b/c surely that's much messier to unpack than 16 bit, which is 2 bytes, not 1 7/8 bytes ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I think either still use all 16 bits.
|
|
|
|
|
No, the high but was just unused. I suspect the intent was to make the pallet symetric by using 5 bits for all three colors.
|
|
|
|
|
I have data in a SQL Server™ 2000 database and I would like to write a Windows® Forms app to allow users to export and save the data to Microsoft® Excel. How can I do this using C#?
|
|
|
|
|
Get the Data in data set,data tables and set relationships etc.using data adapter.
Next step is to write into a file using stream object like FileStream
// Get a FileStream object
FileStream myFs =
new FileStream
("myXmlData.xml",FileMode.OpenOrCreate,FileAccess.Write);
You can loop through the rows of your data table and write xml elements and nodes to the xml file
or else
you can use dataset's writexml property
|
|
|
|
|
can we export data from excel sheet to gridview .
if so please send me how it can done
Thank u
Uma
|
|
|
|