|
|
no basically i wnat to diaplay notify message like gmail notify do you have nay idea how we can show this type of alert
|
|
|
|
|
|
hello leppie
Thanks for solving my problem. yes i want to show exactally like that
|
|
|
|
|
Hi,
I was under the impression that if I wanted to center a MessageBox over any window, then I could use this class:
public class Win32Window : IWin32Window<br />
{<br />
private IntPtr m_hWnd;<br />
<br />
public Win32Window( System.Windows.Forms.Control ctrl )<br />
{<br />
m_hWnd = ctrl.Handle;<br />
}<br />
<br />
public System.IntPtr Handle<br />
{<br />
get<br />
{<br />
return m_hWnd;<br />
}<br />
}<br />
}
and then call the MessageBox like this:
Win32Window win = new Win32Window( this );<br />
MessageBox.Show( win, "Nú er gaman" );
but it doesn't work. Does anyone have a clue?
Best regards,
Daniel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Whatever gave you that idea? From the documentation:<bockquote>The IWin32Window the message box will display in front of.That is, the IWin32Window is the owner of the MessageBox , but that doesn't mean the MessageBox will be centered over the owner.
Also, you don't need to implement IWin32Window . The Control class - even from which the Form class derives - implements IWin32Window . You just need to pass a Control reference. What you did was unnecessary.
In order to center a dialog over a particular control or form, you'll need to define your own class that extends Form with all the bells and whistles you need. Make sure you pass an owner Control and set Form.StartupPosition to FormStartupPosition.CenterParent .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
i don't know wheres the error but i'm tired of searching so i'll let u to explore it,
my xml file is like the following.
<code><xml version="1.0" encoding="utf-8">
<VoteData>
<Question id="0" name="do you believe in think tanks?">
<Choice choiceid="1" votes="0" name="Yes">
<Vote ip="192.168.1.1"></Vote>
</Choice>
<Choice choiceid="2" votes="0" name="No">
</Choice>
</Question>
</VoteData></code> i'm trying to use SelectNodes() method to select nodes,
<br />
XmlDocument VoteData = new XmlDocument();<br />
VoteData.Load(@"C:\VoteData.xml");<br />
XmlElement xElement = VoteData.DocumentElement;<br />
XmlNodeList xList = xElement.SelectNodes("/VoteData/Question[@id='0']");<br />
the problem that xList is always empty, no results !
thanx in advance
|
|
|
|
|
Try validating your XML in explorer/any other Xml aware application and you will see its badly formed.
You are missing ? marks in the xml declaration line... its should read:
< ? xml version="1.0" encoding="utf-8" ? >
|
|
|
|
|
the xml is well formed, about the question mark "?" i just removed them when i did the copy and patse here, i think itsn't the problem,
thanx for ur reply
|
|
|
|
|
Xpath can be tricky :p Try some variations eg
/VoteData/Question[@id='0']/
/VoteData/Question[@id='0']/*
VoteData/Question[@id='0']
I cant recall the exact syntax, but something normally is just in the wrong place :p
Also, why not call SelectNodes from the VoteData xml doc itself? that mite be causing the Xpath not to match the VoteData bit.
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
i tried all this variations b4 i post this problem, but i'd like to ask somthin, why its tricky ? no standard ?
thanx for reply
|
|
|
|
|
Its tricky for me as I rarely use it, and tend to forget the exactly syntax. XPath is simply Regular Expressions for XML. The is a complete standard for it. .NET supports version 1.1 I think.
The easiest way to test things is just to start with "*" and continue up to "*/*/*" and see what is really being matched, from there is should be easy, except if you are using XmlNamespaces (which u are not). Your problem looks like a context problem, iow you are starting at the wrong node, like I mentioned in my previous post.
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
Why do you have the in you xml file? Check if xElement is empty
I use something like this and see if sId has some value
XmlNode node;
node = xml.FirstChild;
while (node.Name != "Ticket" & !(node == null))
{
node = node.NextSibling;
}
string sId;
sId = node.Attributes("id").Value;
|
|
|
|
|
while (node.Name != "Question" & !(node == null))
{
node = node.NextSibling;
}
|
|
|
|
|
|
the file may be large and that way may take a long time to select the node i need, do u think that XPath using this way to select nodes ? i dunno
|
|
|
|
|
|
yea thats right, but am implementing a stand alone component that don't relies on database, it has its own data file, thanks
|
|
|
|
|
The XPath is fine, that is not where your problem lies. I just made your XML valid and tested it.
If I have trouble with an XPath, I use XSLerator or something similar to test it, and build it one step at a time.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i think i caught where the problem lies, the problem is me, damn, sorry guys, i didn't paste the exactly code as in my project , its my first time using xml so don't blame me, i think i'm using a namespace, and heres my exactly xml file
<?xml version="1.0" encoding="utf-8"?>
<VoteData xmlns="http://tempuri.org/VoteData.xsd">
<Question id="0" name="do you believe in think tanks?">
<Choice choiceid="1" votes="7" name="Yes">
<Vote ip="192.168.1.1" />
<Vote IP="50.50.20.10" xmlns="" />
<Vote IP="50.50.20.10" xmlns="" />
</Choice>
<Choice choiceid="2" votes="1" name="No">
<Vote IP="50.50.20.10" xmlns="" />
</Choice>
</Question>
<Question id="2" name="bet7eb Sawsan?">
<Choice choiceid="0" votes="0" name="aiwa" />
<Choice choiceid="1" votes="0" name="la2" />
<Choice choiceid="2" votes="0" name="moot" />
<Choice choiceid="3" votes="0" name="ya3ney" />
</Question>
</VoteData>
i didn't think that will be a diffrent while using namespace, so now, what should i change in my C# code to let XPath work ?
sorry guys again and thanx
|
|
|
|
|
Hi all,
I am trying to two things but am unable to do them.
1. I am trying to dynamically add some element in the HTML page with the help of createElement function. I am able to that correctly in IE but not in Netscape 4.7 I refered the javascript reference which says that createElement is not compatible with Netscape. So what is the other way round to do it.
2. Also I am trying to make a div element fixed in the page. That is even if I scroll down the page the div element which is a type of layer does not scroll down. It is possible in IE as:
document.getElementById("divname").style.pixelTop = document.body.scrollTop;
but it is not possible in Netscape4.7 as netscape does not support scrollTop. What is the other way round to do it.
Please help.
|
|
|
|
|
Why in gods name are you still trying to support Nutscrape 4.x? That browser is older than the theory of evolution!
|
|
|
|
|
Due to some urgent requirenments I would make my programme compatible with Netscape 4.7 and also Firefox.
|
|
|
|
|
firefox i can understand, its recent and its reasonably well used - NN4.xx on the other hand is neither.
You will have to see if you can dig up any old NN Javascript docs, as that will guide you on how do deal with the DOM in NN. Most things are possible from a DHTML standpoint, but some just simply are not with that browser.
From memory, you can create a div layer and then write HTML into it using innerHtml property - but you can't createElement like in newer DOM's.
|
|
|
|
|
Your question has absolutely nothing to do with C# or even the .NET Framework and should be asked in the Web Development[^] forum. Even if this is produced from an ASP.NET application written in C#, your question is regarding client-side HTML which ASP.NET has little to do with (and nothing in this case). ASP.NET produces HTML and other content that is downloaded to the client. What happens on the client is totally up to the client, which is why your question belongs in the Web Development forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|