Jump to content
Xtreme .Net Talk

Cags

Avatar/Signature
  • Posts

    699
  • Joined

  • Last visited

Everything posted by Cags

  1. Something along the lines of... DropDown SelectionChangeCommitted SelectedValueChanged SelectedIndexChanged is that sufficient?
  2. Assuming you mean what I think this can be achieved by typing three slashes (///) before a method... this will automatically make the following appear. /// <summary> /// What method does /// </summary> /// <param name="myParam">What parameter is</param> /// <returns>what the method returns</returns> public string MyMethod(string myParam) { }
  3. From what I can tell theres nothing wrong with the code you have posted, the problem could be elsewhere. Do both listviews have the same amount of columns? Are they both set as detailed view? EDIT:- Oops i just noticed your calling BeginUpdate and EndUpdate on the left listview, but as you are adding the items to the right listview its that you should be calling them on.
  4. If your still interested, try taking a look at this... http://www.dotnet247.com/247reference/msgs/21/108780.aspx
  5. I would suggest that there must be another problem, because the System.IO.File.Delete method should work with hidden files.
  6. I suspect thats because you did something like this.... ColorDialog1.ShowDialog() If ColorDialog1.ShowDialog() <> DialogResult.Cancel Then lblLeftSide.BackColor = ColorDialog1.Color frmMain.lvwLeftList.BackColor = ColorDialog1.Color End If The line If ColorDialog1.ShowDialog() <> DialogResult.Cancel Then displays the dialog and checks the result so you don't have to call it seperately from that line of code.
  7. You need to check how the user exits the ColorDialog form. Basically the following code says if the user didn't click cancel then change colours. You could also change this to say if the user did click ok by changing it to == DialogResult.Ok. If ColorDialog1.ShowDialog() <> DialogResult.Cancel Then lblLeftSide.BackColor = ColorDialog1.Color frmMain.lvwLeftList.BackColor = ColorDialog1.Color End If
  8. Perhaps I'm missing the point here somewhere, but why are you clearing the list at all? If I'm understanding you correctly then your application queries the database and returns a list of names. These names are then stored in an arraylist aswell as in the combobox. Now it seems to me that your saying when you select an item in the combobox you are re-querying and thus re-populating the arraylist and the combobox. I guess what I'm trying to say is why does selecting a single item from the list require the list to be updated? I would have thought that when you select a name in the comobox you would want to perhaps populate other controls with information about that person. But I can't see why selecting that person requires the list of people to be updated?
  9. I thought it was too simple to start with, but when I checked it i thought hmm... :D
  10. Did you actually try the code mandlebrot? The ToString() method of a flagged enum, returns a full string of all values that are true.
  11. You mean like this... Dim myString as String = myGraph.ToString() EDIT:- if you need the int value to be in the string aswell then Dim myString As String = myGraph.ToString() & " {" & Convert.ToInt16(myGraph) & "}"
  12. It is not as odd as it may seem if you think it through. For an application to access its referenced libraries, these libraries must be in one of a few places. In the same directory as the application, the system folder or a folder added to the references path list in visual studio. For that referenced library to work, any libraries that it references must also be in one of these folders. As such whenever you build the application it tries to copy all the files to the output directory. Ok, that didn't get confusing at all :D
  13. Theres no reason why it wouldn't work 'manually' if you like, i.e without a single solution. It can just be tricky getting the references set up correctly. When I was on my placement one of my collegues prefered to work with seperate solutions. But this meant changing all the build events, or manually moving all of the compiled dll's. Personally I could never see the point since VS will do it all for you. As for saying a solution is an overkill, I've personally never worked on a project that wasn't in a solution. Whats more the situation you are describing that uses lots of dll's made by yourself is the ideal candidate, as this is what a solution is for. If you want to do it manually however, as long as all the reference's are set correctly and all dll's are located in the same folder, it should work fine. The tricky part is getting all the references right. EDIT:- putting all teh files you wish to reference in the output directory before compiling may help.
  14. Well I'm obviously missing something here, I don't see at all why my example defeats the objects of using .Net, it follows the exact structure you layed out.
  15. So... [a] references , [c] and [d]. references [d] [c] references [d] If this is the case then there is nothing inherently wrong with the structure of your dll's, which means there is probably something conflicting with the code. Perhaps the same class name in two dll's causing a problem. As Nerseus's says having all the projects in the same solution file would be the ideal solution, is this how you have them? Heres an example. Test App.zip
  16. I've never really liked the Xml Document, I've always found it to be alot slower and very system resource intensive. This isn't really going to matter with smaller pieces of xml, but with large files it can literally cripple a PC. As Nerseus has shown however it is still a valid alternative, and can lead to easier to understand code. NB. Some of these issues may have been addressed in .Net 2.0, my comments are based on .Net 1.1.
  17. Full code is here, I have no idea if it will work correctly though as I don't know exactly what XML contains. Imports System.IO Imports System.Xml Dim myStringReader As New StringReader(Xml) Dim myXmlReader As New XmlTextReader(myStringReader) While myXmlReader.Read() If myXmlReader.NodeType = XmlNodeType.Element Then If myXmlReader.Name = "usersname" Then usernameTextBox.Text = myXmlReader.ReadInnerXml() ElseIf myXmlReader .Name = "surname" Then surnameTextBox.Text = myXmlReader.ReadInnerXml() End If End If End While
  18. I'm not surprised it doesn't work you have passed it another string not a stringreader, and as such it assumes its a path. Your amendment of my code completely changed the type of object being passed. If you wished to shorten the code in the project it should have been like this. Imports System.IO ' the code needs to create an instance of a stringreader Dim stringReader As New StringReader(XML) ' your code creates an instance of a string Dim stringReader As New String(XML)
  19. Unless you can provide the exact string of xml you are attempting to parse, I can't really help you any further. It is very difficult for me to run tests without having the same data.
  20. Cags

    Array problem

    Which one is the problem, it errors (in which case please provide an indication of the error given), or it returns and empty string?
  21. Cags

    Array problem

    What do you mean by you get nothing, does it error or perhaps return an empty string?
  22. It would produce an error, the overload I specified requires a path, what you are passing it is not a path, it is a string of xml data (and thus contains invalid path chars such as < and >). One of the other overloads can work with a string but it requires extra parameters and gets quite complicated. Basically it sounds like your in a situation where you wish to parse a string object as though its xml. I personally know of no easy way of doing this without saving it to disk first or writing your own parser. What I was trying to get at in my previous post was that perhaps theres a better way to get the xml in the first place rather than ending up with it as a string. Having said all this I've had a look at the overloads, the following might work, but I haven't tested it. 'load your xml fragment / string into a string reader object Dim stringReader As New System.IO.StringReader(XML) 'then use the overload that excepts the single parameter TextReader Dim xmlReader As New XmlTextReader(stringReader)
  23. Are you loading the text into the first textbox yourself? If you are then you don't need to as its much easier to work with the text as an xml file. If your not then you have two options. There's an overload for the xmltextreader that works with a string rather than an xml file, however I've never personally used it. Alternatively you could write the contents of the initial textbox to a temporary file, thus allowing you to use the overload I suggested. If you post the exact code that produced the error message you have provided I might be able to help further.
  24. The two common methods I know of are using the XML DOM (document object model) and the XmlTextReader. Using the DOM can be alot easier to understand but it's slower and requires alot of system resources, especially with large xml files. Heres a quick example of how to use the XmlTextReader. Dim path As String = "c:\myfile" Dim reader As New XmlTextReader(path) While reader.Read() If reader.NodeType = XmlNodeType.Element Then If reader.Name = "usersname" Then usernameTextBox.Text = reader.ReadInnerXml() ElseIf reader.Name = "surname" Then surnameTextBox.Text = reader.ReadInnerXml() End If End If End While 'by the sounds of it your xml is being used as storage for a collection, 'if this is the case you will first have to navigate to the right item 'using similar methods to those shown here. NB. Code not tested, might be a few bugs.
  25. I'd create a custom typed array, that should solve the problem.
×
×
  • Create New...