|
just test for null. eg.
XmlDocument oXML = new XmlDocument();
oXML.LoadXml("<root><name id='1' value='ggg' value2='ttt'/><name id='2' value='erer'/></root>");
XmlNodeList nl = oXML.SelectNodes("//name");
foreach (XmlNode n in nl)
{
if (n.Attributes["value2"] != null)
{
}
}
|
|
|
|
|
when the below statement is executed then only getting exception(i.e. focusing to catch())
if (n.Attributes["value2"] != null)
|
|
|
|
|
Hi.
How do you do what I've already written in the title? Can it be done?
Thanks.
|
|
|
|
|
yourlabel.BackColor = System.Drawing.Color.Transparent;
|
|
|
|
|
Thanks, but for some reason it doesn't seems to work. I've placed my label on top of a ToolStrip, which has the basic gradient drawn on it. I've set the label's color to transparent, but it still shows the default grey(Control) color.
|
|
|
|
|
Problem with Transparency is that it shows the BackGroundColor of the Parent Control.
Which means if you change the BackColor of your Parent Control, you will see this color also at the Labals BackColor.
blackjack2150 wrote: I've placed my label on top of a ToolStrip, which has the basic gradient drawn on it
I don't know if I understand what you have done and what you whant to see.
Is the ToolStrip the Parent of your Label? (If this is possible!)
Is there a BackgroundImage involved or are you Drawing on your ToolStrip?
All the best,
Martin
|
|
|
|
|
|
Hello,
As I never worked with .Net>1.1 I'm not sure how the ToolStrip workes.
What I guess is, that the Label is in the same Container as the TollStrip, and it's just higher in the z-Order. (Brought to front)
I think this makes it impossible that the Label gettes the same gradient Background as the ToolStrip, It will allways show the Color of the ParentControl.
I think you have to write(paint) directly on the ToolStrip.
All the best,
Martin
|
|
|
|
|
I was afraid of that.
Anyway, it's not such a big deal and it's not worth too much effort. It will just fine in the present form, but it was just a curiosity of mine.
Thanks for your time. I appreciate it.
|
|
|
|
|
Glad I could help (In fact, by not really solfing the problem )
You are wellcome!
|
|
|
|
|
Help Help!
I've created an array of small picturebox's on a form, and want them to highlight when I click on them, but I don't know how to let the event handler method know which picturebox (which member of the array) ive clicked on...
See code below:
private PictureBox[,] lifeForms;
public coverForm(int dimX, int dimY)
{
InitializeComponent();
lifeForms = new PictureBox[dimX, dimY];
for (int y = 0; y < dimY; y++)
{
for (int x = 0; x < dimX; x++)
{
this.lifeForms[x, y] = new System.Windows.Forms.PictureBox();
this.paper[x, y] = lifeForms[x, y].CreateGraphics();
this.Controls.Add(lifeForms[x, y]);
lifeForms[x, y].BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
lifeForms[x, y].Location = new System.Drawing.Point((x*20)+4, y*20+4);
lifeForms[x, y].SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
lifeForms[x, y].Size = new System.Drawing.Size(20, 20);
lifeForms[x, y].Show();
lifeForms[x,y].MouseClick += new MouseEventHandler(this.selectDim_Click);
}
}
}
private void selectDim_Click(object sender, EventArgs e)
{
How can I read which picture box the user has clicked on down here?!!
}
Mark.
|
|
|
|
|
Hello,
The sender object is the instance of the pictureBox you whant.
You just have to cast it.
PictureBox actBox = sender as PictureBox
if(actBox!=null)
{
}
Hope it helps,
Martin
|
|
|
|
|
Thanks heaps guys I've got it working now... Legendary!!!
Mark.
|
|
|
|
|
You can assign tag to each picturebox and then find out which one was clicked by examining sender
|
|
|
|
|
Hello,
It's not neccessary to iterate threw the collection to find and compare the tag, and then find a member which is already passed by the event itselfe!
All the best,
Martin
|
|
|
|
|
You won't have to iterate through all the collection you just cast sender to picturebox and then examine its tag to see which one is it.
|
|
|
|
|
Sorry missunderstood your answer!
Giorgi Dalakishvili wrote: just cast sender to picturebox
That's what I answered before.
Giorgi Dalakishvili wrote: and then examine its tag to see which one is it
Why would you have to use a tag if you have the instance itselfe?
All the best,
Martin
|
|
|
|
|
If you are doing the same thing for every picturebox then you don't need but if it depends on which picturebox it is then you will need to examine tag. In this question I think only highlighting is needed and in that case you don't need but he also asked how to find out which picturebox was clicked. So if he is interested in which picturebox is the sender then he will need.
|
|
|
|
|
this problem is the ocx control must used in multiForm(LoginForm,MainForm...). But these forms must Call only one that the ocx instance .
Please give me a good scheme for solving this Problem with C#.
Thanks.
|
|
|
|
|
I have a problem, hope someone can help me:
I have 2 computer conected by LAN. I want run a program(ex: Notepad) on Computer B from computer A.But I can't find any function to do that.
Anyone can solve that problem, help me please!
Thank a lots!
|
|
|
|
|
I really don't know what this question
is doing in a programming discussion board.
However, use this programm.
http://www.realvnc.com/
Greetings
pdluke
|
|
|
|
|
I think he wants to do it through code, as this is a programming discussion board...
I made a program that does this sort of thing. What I did is made a windows service for my clients, although a client application would work too. Then I made a server application that would tell the client what program to start.
The client windows service would invoke the start of the program.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Oh thanks for the reply.
I didn't even think to use a service for so a "trivial" thing.
I often use WCF-Services by my self, but these are for some bigger projects.
sorry, that misunderstood the question
|
|
|
|
|
Well I needed to use a service because the computers I needed the service on were headless servers. They needed to be able to always be waiting for the queue to run the passed program.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Sorry, double post
|
|
|
|