|
The problem with the XmlReader class is that it can't predict the future. You can't find out if there are child nodes to the current node you just read without reading through the child nodes. If you really need this, try looking at XmlDocument instead where you read the entire XML file, then you can sift through all the nodes to get the information you want.
|
|
|
|
|
Hi.
I'm gonna create a textbox as when a user press Enter key, <br /> insert into the textbox instead of \n or \r\n
Could you guide me ?
Thanks
|
|
|
|
|
Hi,
Controls that accept keyboard input have KeyDown, KeyUp, KeyPress events. Use one or more of them to achieve your goals.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks . I know them.
I don't know how I can implement it
|
|
|
|
|
They did invent a beautiful thing especially for you, it is called documentation.
If you don't know where it is, Google may show the way. Studying a book on the subject might be useful too.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
use KeyDown event, check if its Enter Key or not. If yes
TextBox.Text = TextBox.Text.Replace("\r\n", "<br />");
or
TextBox.Text = TextBox.Text.Insert(TextBox.SelectionStart, "<br />");
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thank you Xmen W.K.
But your code doesn't work.
It inserts both of <br /> and \r\n
I've used this code, it works.
private void textBox_KeyPress(object sender, KeyPressEventArgs e)
{
TextBox textBox = sender as TextBox;
if ((int)e.KeyChar == 13)
{
try
{
e.Handled = true;
textBox.Text += "<br />";
}
catch { }
}
}
|
|
|
|
|
Well, it wasn't full code. But your code is a bit buggy What if the carret position is in the middle of text ?
Thats why use string.Insert as I posted above.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello everyone!
I am looking for some training on a low budget. I do have several books, but was hoping that someone had some video courses they want to get rid of. I also do have a subscription to LearnVisualStudio, but some of their content is older than what I need.
Looking for:
C# (3.0 ideally)
ASP .NET 3.5 is a bonus as well.
AppDev has great training, so if anyone has their training they could sell or lend, that would be great.
|
|
|
|
|
|
These are okay and I did know about them, but they are very specific.
I am looking for content as verbose as AppDev.
I know that usually cost $$$, but I am hoping someone out there has materials they no longer use.
-Brian
|
|
|
|
|
Can anyone tell me how to open any file using its default program ?
|
|
|
|
|
Hi,
Process.Start("file") simulates double-clicking the file in Windows Explorer.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi
I am working on a project that will use tabbed interface for displaying multiple documents (like Visual Studio). I can either I treat it like MDI interface (setting IsMdiContainer to true ) and deal with the difficultis of making it actually tabbed (AFAIK this is not exactly straightforward). Or (my preference) forget about MDI and simpliy open individual documents in individual tabs and that's it.
What is the advantage of the former approach?
Thanks for clarification, H.
|
|
|
|
|
Hi H,
I just built an application using the approach you mention (tabbed with an MDI on the outside). I find that this interface works extremely well for a large number of applications. In particular, the ability to constantly show navigation / menu bar / etc on the MDI parent.
I used Infragistics tool suite to build out the interface - they have a component that actually makes MDI children tabbed - and abstracts most of the work for you. I highly recommend checking it out! The component is called UltraTabbedMDIManager ...
|
|
|
|
|
Principally I guess that in standard MDI you can have multiple views on the screen at once where tabs kind of limit it to one. Some 3rd party docking controls allow you to go either way by dragging views around - like in Visual Studio.
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: Principally I guess that in standard MDI you can have multiple views on the screen at once where tabs kind of limit it to one.
Agreed. This is the primary reason my personal browser's been Opera for the last 7+ years.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Why not use a TabControl then?
|
|
|
|
|
...if your idea of fun is as warped as mine. No Visual Studio allowed.
static void Main(string[] args)
{
try
{
TestStatic.SaySomething("HI");
}
catch (Exception error)
{
Console.WriteLine(error.InnerException.Message);
}
try
{
TestStatic.SaySomething("Hi 2");
}
catch (Exception error)
{
Console.WriteLine(error.InnerException.Message);
}
Console.ReadLine();
}
}
public class TestStatic
{
static TestStatic()
{
throw new Exception("Afternoon Exception");
}
public static void SaySomething(string message)
{
Console.WriteLine(message);
}
}
Regards,
Rob Philpott.
|
|
|
|
|
|
Did you cheat?
Regards,
Rob Philpott.
|
|
|
|
|
Nope. This is easy, the first time a static method gets invoked, the static constructor is invoked. Yours throws an exception. The second time, the static constructor is not invoked again, so your call succeeds.
|
|
|
|
|
Le Centriste wrote: Nope. This is easy
Why did you get it wrong then?
Regards,
Rob Philpott.
|
|
|
|
|
I got it wrong? Then, why did you accuse me of cheating?
|
|
|
|
|
Hes playing. But you did get the answer wrong.
|
|
|
|