|
What exaclty are you trying to do. Permanently remove nodes from the document? Copy nodes to nodes outside the document?
|
|
|
|
|
like..if i document that was like..
<phonebook>
<contact>
<firstname>A
<lastname>A
<phonenum>A
<titel>A
<nickname>A
<country>
<city>A
A
<zipcode>A
<job>A
<mail>A
<site>A
now suppose i want to remove the field called zipcode..
how do i do that?
|
|
|
|
|
<?xml version="1.0"?><br />
<!--Mohamed's Address Book - WRITING XML IN VB.NET--><br />
<!--AUTHOR - Mohamed Magdy--><br />
<phonebook><br />
<contact><br />
<firstname>A</firstname><br />
<lastname>A</lastname><br />
<phonenum>A</phonenum><br />
<titel>A</titel><br />
<nickname>A</nickname><br />
<country /><br />
<city>A</city><br />
<address>A</address><br />
<zipcode>A</zipcode><br />
<job>A</job><br />
<mail>A</mail><br />
<site>A</site><br />
</contact><br />
</phonebook>
|
|
|
|
|
i dunno why im unable to put xml text here
|
|
|
|
|
|
<?xml version="1.0"?>
<!--Mohamed's Address Book - WRITING XML IN VB.NET-->
<!--AUTHOR - Mohamed Magdy-->
<phonebook>
<contact>
<firstname>A</firstname>
<lastname>A</lastname>
<phonenum>A</phonenum>
<titel>A</titel>
<nickname>A</nickname>
<country />
<city>A</city>
<address>A</address>
<zipcode>A</zipcode>
<job>A</job>
<mail>A</mail>
<site>A</site>
</contact>
</phonebook>
I want to remove the node called zipcode
|
|
|
|
|
Try this
System.Xml.XmlNode node;
System.Xml.XmlDocument doc = new XmlDocument();
doc.LoadXml("<person><name>jon</name><age>35</age><zip>47408</zip></person>");
this.textBox1.Text=doc.InnerXml;
node = doc.SelectSingleNode("person");
node.RemoveChild( doc.SelectSingleNode("person//zip"));
textBox1.Text += "\n" + doc.InnerXml;
|
|
|
|
|
Hello, I'm trying to grab the entire bitmap for a Windows Form when performing a drag/drop operation, using the code below.
This works fine, except for when part of the form is off-screen or hidden by, say, another window -- in this case the bitmap returned includes part of another window / the Windows Taskbar or whatever is there.
Does anyone know of a way to get the entire bitmap for a Window (i.e. the image that would be shown by that window if it was completely on-screen, topmost and visible). Is there perhaps a native API that can help with this?
Any ideas would be much appreciated, as I'm beginning to think this can't be done.
Andy
[DllImport("gdi32.dll")]
public static extern bool BitBlt(IntPtr hdcDst, int xDst, int yDst, int cx, int cy, IntPtr hdcSrc, int xSrc, int ySrc, uint ulRop);
public Image GetBGImage(System.Windows.Forms.Form formToCopy)
{
Graphics g = Graphics.FromHwnd(formToCopy.Handle);
Bitmap bm = new Bitmap(formToCopy.ClientRectangle.Width, formToCopy.ClientRectangle.Height, g);
Graphics g2 = Graphics.FromImage(bm);
IntPtr hdcScreen = g.GetHdc();
IntPtr hdcBitmap = g2.GetHdc();
BitBlt(hdcBitmap, 0, 0, bm.Width, bm.Height, hdcScreen, 0, 0, 0x00CC0020);
g2.ReleaseHdc(hdcBitmap);
g.ReleaseHdc(hdcScreen);
return bm;
}
|
|
|
|
|
Hello,
Is there a way of formating the number string is such a way, if an input string is:
450000 for example.
How can I make the output string to be something like that:
450,000.
Sort of putting commas for each of the hundreds
Thank you
|
|
|
|
|
I just tested this... you can do the following....
<br />
string buff;<br />
int test = 450000;<br />
buff = test.ToString("###,###");<br />
test = 450000000;<br />
buff = test.ToString("###,###");<br />
And the commas are put in the right places for both tests.
Steve Maier, MCSD MCAD
|
|
|
|
|
Do you have a string or a number? If you have a number, it's easy. Numeric format with zero decimals:
string result = myNumber.ToString("n0");
You can also create a NumberFormatInfo object, where you can specify any format you like:
NumberFormatInfo info = new NumberFormatInfo();<br />
info.NumberGroupSizes = new int[] {1, 2, 1, 0};<br />
info.NumberGroupSeparator = "-beep-";<br />
string result = myNumber.ToString("n0", info);
Edit:
If you have any problems with the first example because of locale settings, use an invariant format info:
string result = myNumber.ToString("n0", NumberFormatInfo.InvariantInfo);
---
b { font-weight: normal; }
|
|
|
|
|
Hello Everybody
I want to print a multiple pages document. But when I draw the content, I don't know how to get a new page, so the content beyond one page will be lost. Does anybody know how to solve the problem please???
Thanks very much
Asura
|
|
|
|
|
To get additional page to be printed
Set PrintPageEventArgs.HasMorePages to true
private void printDocument1_PrintPage(object sender,System.Drawing.Printing.PrintPageEventArgs e)
{
if(your condition)
e.HasMorePages = false;
else
{
e.HasMorePages = true;
}
}
look at
PrintPageEventArgs.HasMorePages [^]
MCAD
|
|
|
|
|
My dad is trying to teach me C# . NET and i stumbled onto a problem while trying to create my own program. I would like to know how to take the numbers of one text box, multiply them by 2 and project them onto another textbox. Keep in mind though that im a begginer and dont understand hard code. Thanks for your help
|
|
|
|
|
What you have to do is to convert the string that you get from the text box into a number. Then you can do the math, and finaly convert it back to a string and put it in a text box.
AnotherTextbox.Text = (Convert.ToInt32(OneTextbox.Text) * 2).ToString();
Step by step:
string inputValue = OneTextBox.Text;<br />
int numericValue = Convert.ToInt32(inputValue);<br />
int calculatedValue = numericValue * 2;<br />
string convertedValue = calculatedValue.ToString();<br />
AnotherTextBox.Text = convertedValue;
---
b { font-weight: normal; }
|
|
|
|
|
Wow thanks you so much youve been a big help
|
|
|
|
|
Hmmm...I still have a problem. When I press the button to do the process it tells me that the imput string was the wrong format. My e-mail is lalaland@moscowmail.com if you could please i would really like some help.
|
|
|
|
|
Oh my bad I accidently switched the textboxes around but everything works. Thanks again.
|
|
|
|
|
Hi,
I Have a Problem and I Want anyone help me,
I Have Five Forms. The Fifeth one Contain Tab Control, This Tab Control Contain Four Pages And I Want By Object-Oriented Put The Four Forms In The Four Pages Of The Fifth Form.
|
|
|
|
|
Hi!
Convert your four Form s into four UserControl s and for each TabPage set one of these UserControl s as the only child with DockingStyle.Fill so that it occupies the whole TabPage .
Regards,
mav
|
|
|
|
|
Thanks For Help Me,
You Get What I Mean.
|
|
|
|
|
My application has several windows, can i somhow iterate trough them and set some property for all of them?
for each windows in myapplication ... or something like that...
I a beginner so please give clear examples, or i will not get it
R
Me
|
|
|
|
|
If your Application Type is MDI you can iterate through
Them By write somthing like
foreach(Form form in this.MdiChildren)
{
}
MCAD
|
|
|
|
|
thx for anserw
This will iterate trough opened windows, i would like to iterate trough all windows in the application, also those that have not been loaded yet, is that possible?
|
|
|
|
|
Hello, i have a MDI application with several child windows, my problem is that i wont the user to be able to open only one instance of each window, but to have all different windows open at same time (or the amount he choses). How do i do this? With active MDI child property i can only acess the active window, and thus the user always can open a new instance of a not active window. Please advice me, i would apriciate some code examles.
R
Johan
|
|
|
|