Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 1180270

@User 1180270
About
Posts
5
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Indexed textboxes
    U User 1180270

    An alternative approach could be to generate the array dynamically, the framework is already storing references to all of the controls, both static and dynamic, so you can just recurse through the ControlCollections pulling out all of the ones of the required type. private void searchControlTree(ControlCollection colControls , ArrayList allCtls, System.Type ctlType) { foreach (Control c in colControls ) { if ( c.GetType() == ctlType) allCtls.Add(c) ; if (c.Controls.Count > 0 ) searchControlTree(c.Controls, allCtls, ctlType ) ; } } public ArrayList findControlByType( System.Type ctlType) { ArrayList allCtls = new ArrayList(); searchControlTree(this.Controls, allCtls, ctlType) ; return allCtls ; } ArrayList a = findControlByType( typeof(TextBox)) ; If you need a real array at the end the ArrayList has a ToArray() method. If you combine this approach to finding the controls together with the control Name or Tag properties you can filter out whatever controls you want. Hope this is usefull Jackson

    C# database data-structures tutorial question

  • @-quoted strings
    U User 1180270

    I think your right. Thanks Jackson

    C# csharp debugging xml help tutorial

  • @-quoted strings
    U User 1180270

    Senthil, Yes - this does indeed solve the problems for newlines, and is the route I had started down. However the issue with this approach is the I have to code up a method that knows about all of the escape codes and transforms them. I was hoping to find a method that didn't require that I capture this information in code. However I can't think of anything better :) and it should be possible to write a big regexp that covers of the escape sequences I want to allow. Thanks for the help Jackson

    C# csharp debugging xml help tutorial

  • @-quoted strings
    U User 1180270

    Well - I've added the following two lines to the app: System.Console.WriteLine(format); System.Console.WriteLine("test\nstring"); And this produces the following in the Output Window: The user says\n{0} test string Just to confuse things further before I display the final string from the StringBuilder I looked at the value in the string and the debugger shows the following: msg="Test Dynamic Form\nLess than 20 users impacted\nNo you can't\nNO VALUE SELECTEDThe user says\\nTest" The debugger does not show the @ for a @-quoted string this time and the final \n has been escaped! It isn't escaped when its in the variable format - just to be sure i replaced all occurances of \ with ! and printed out the result. So - still confused here:-D

    C# csharp debugging xml help tutorial

  • @-quoted strings
    U User 1180270

    I've got a slight problem with @-quoted strings in C#. I'm reading some XML formatted data using a XmlTextReader. At some point in this process I get a chunk of text that contains some escape sequences. I want to use this as the format part in an StringBuilder.AppendFormat() method. StringBuilder sb = new StringBuilder() ; string format = myXmlTextReader.Value ; sb.AppendFormat(format, ...) ; However the value in format is @-quoted. If I look in the debugger it shows the following: format = @"The user says\n{0}" I just can't work out how to un @-quote the string in code. :confused: I want the newline in the string not the \n. There must be a simple way to do this but I just can't find it! TIA Jackson

    C# csharp debugging xml help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups