Jump to content
Xtreme .Net Talk

rekam

Avatar/Signature
  • Posts

    43
  • Joined

  • Last visited

Everything posted by rekam

  1. Hello, there ! I have a sub which have some arguments. One of the is optional. The problem is that this optional argument is a System.Windows.Form.Button... If I declare the sub like this, it doesn't work : private sub createNew(Byval text as string, byval number as integer, optional byval buttonSelected as System.Windows.Form.Button = ??????) ... ... end sub I don't know how to put instead of the ????? Someone has an idea ? Thanks!
  2. Ok, I found a way to manipulate this. Instead of cloning the nodes, I do a selection and import it to my 1st file. file1stFile = New XmlDocument() ... ... ... fileParam = New XmlDocument() fileParam.Load(Environment.CurrentDirectory & "\defaut\" & Me.cbChoixParam.SelectedItem) parameters = fileParam.SelectSingleNode("defaultValues/paramDefault") param = file1stFile .ImportNode(parameters, True) game.AppendChild(param) Paramters, param and game are XmlElement. The "fileParam" is the file where I have node to put in my 1st file. The "game" element belong to the first file. With ImportNode, there's no problem of compatibility, but I didn't resolve the problem of the XmlNodeList. Well, it works that way, so it's c:D :D l
  3. I tried something like that : Dim nodeList as xmlNodeList Dim fileToChange as new XmlDocument() fileToChange.Load("file1.xml") nodeList = fileToChange.selectNodes("rootFloor/floor1/floor2") Dim i as integer For i = 0 to nodeList.Count - 1 aNodeWhichHasBeenDeclaredBefore.AppendChild(nodeList.item(i)) next This doesn't work because : "The node to be inserted is from a different document context" I'm not sure, because the "aNodeWhichHasBeenDeclaredBefore" come from a XmlDocument() file, just like fileToChange...So, I don't know...
  4. Hello ! I have a XmlNodeList, which contains some nodes. I would like to "AppendChild" this nodeList to my xml file. But the method AppendChild support only XmlNode. Is there a way to simply take th nodeList and write it into a file ? Thanks!
  5. Unfortunately, PlausiblyDamp, all the data are erased when redim, even with preserve... Well, here is a part of my code. I have a Xml request which returns me some values (that is working). dim cpt, values as integer for cpt = 0 to 20 'my request xml which depends on cpt values = 0 while xmlResult.MoveNext() values += 1 end while if values = 2 then redim preserve stringArray(30, 1, 1) 'the code for this section else if values = 4 then redim preserve stringArray(30, 3, 3) 'the code for this section else redim preserve stringArray(30, 3, 15) 'the code for this section end if next The thing is : the first dimension of the stringArray is a key. And, for example, the key with the value "2" has only 1 case in the second dimension. The key "3" has 3 cases...It will be easy with dynamical array...But well, Preseve doesn't preserve the data allready entered in the stringArray.
  6. Well, in fact, all I would like to have is a : Dynamical multi-dimensional String Array that we don't have to redim That strange beast exists ?
  7. Argh, it doesn't work like I want :( ... I tried with Squirm's solution, but every time I redim the array, I erase all the content inside. With the collections, I have done something just like my precedent post, but it doesn't work. I tried other solutions, something like that : Dim myarray(30, 3, 1) as string and put in the last dimension a collection of values (sometimes 4 values, sometimes 16, or anything else). But it returns me an error because a Collection....is not a String, of course. Just now, I tried to use an ArrayList. I can create them dynamically : Dim myArrayList( , , ) as ArrayList, but if I want to put a integer or a string inside it on the position, let's say, (21, 1, 3), it tells me it's not an Array... pff.....I don't know how to do, sob sob... Has someone an idea ? Here's my problem : I have an unknown number of parameters (for a game). Each parameter has between 2 and 4 types, and each type has 4 or more values. So a multi-dimensional array seems to be the best way to resolve this. But...
  8. Thanks Squirm I found an anthor method with Collection Dim list as new Collection() Dim list1 as new Collection() Dim list2 as new Collection() Dim list3 as new Collection() Then I put anything I want into these 3 lists and then : list.Add(list1) list.Add(list2) list.Add(list3) I don't know if it's very useful, but it works quite well. I just odn't know how to reach the values of each lists, but I'll find ;)
  9. Hello I have a multi-dimensional array like this : Dim myStringArray(30, 3, 12) as String The problem is that I need a dynamical multi-dimensional array and I have really no idea how to do it... Thanks
  10. It's okay, I'm just dumb...There's a clear() sub which does that....and I didn't saw it...sob sob...
  11. Hello I have a comboBox which contains the list of all files in a directory. After an operation, which add a file to this directory, I would like to update the comboBox. I tried the dispose() sub, but it erase totally the comboBox. I just want a simple removeAll() sub. I saw a remove() sub....so do I have to do a loop and remove all elements like that ? Or is there a more simple way to do that ? Thanks
  12. Hello ! Is there a way to prevent user to use the ALT+TAB function ? Thanks a lot !
  13. Helloooo ! I would like to do a simple operation with array and XML, but I'm a newbie and I don't know how to do... I have an XML file with a <key> tag and a <value> tag. One <key> can contain many <value>. What I want is to have a bidimensional array which have the <key> for the first dimension and the <value> for the second. I think there's something I don't understand with array or collection. I tried to use them but I have always a NullReferenceException. Somebody has an idea:D ?
  14. Great, really great ! It works at last !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you very much:D
  15. Yeah, ok :) ! I tried to do so. It seems that we can't override a KeyPress method, but we can overload it. I really don't the difference, the fact is, in the end, that doesn't work. However, I have build my new component and I succeded in putting it into the toolbar. When I inherits it from a textBox, it takes the properties of the textBox, great :) ! But the overload keyPress method I add isn't interpreted by the program. Hum, here's a part of the class : Public Class NumericBox Inherits System.Windows.Forms.TextBox Public Overloads Sub OnKeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) If Me.controleNombre(Me, e) = False Then e.Handled = True End If End Sub Private Function controleNombre(ByVal textBox As System.Windows.Forms.TextBox, ByVal e As System.Windows.Forms.KeyPressEventArgs) As Boolean Dim estUnNombre As Boolean estUnNombre = True If (e.KeyChar < "0" Or e.KeyChar > "9") Then estUnNombre = False End If Return estUnNombre End Function End Class The function "controleNombre" works well. But even if I put System.Windows.Forms.MessageBox.Show("Hello") in the KeyPress method, nothing happens...Where's the problem ?
  16. Hellooo! Well, here's the point. Everybody knows what's a TextBox. My goal is to have something like a TextBox, but in which we can only put numbers. I've done a KeyPress method which does all the controls I want, the problem is not here. I'd like to have a component in the ToolBar, which I can drag 'n drop onto the Form, just like a TextBox. But this NumericBox component would have the capacity to accept only numbers. Someone has an idea ? I checked the MSDN documentation and forums too, but I didn't find a single clue....
  17. Ups, it's a bit hard to understand. Maybe I ask a question more easy. In fact, what I would like to do, it's to insert a node where I want. I saw the Insert method "myTreeView.Nodes.Insert()" . But I need an integer which represents the specified location of the new node. I tried, but I can't understand where I can get it...There is a method "mytreeView.Nodes.IndexOf" but I don't understand it (sob)...:( If anyone knows, I will say a big "THANKS"
  18. Hello ! I'm a beginner in vb.net and I need a little help. I have a XML file which as this structure : <index> <node> <text>blublu</text> <text>blublu</text> </node> <node> <text>blublu</text> <text>blublu</text> <text>blublu</text> </node> <node> <text>blublu</text> <text>blublu</text> </node> ... </index> Each node represents a root node in the treeview and each text is a child. I would like to put this into the treeview. But it seems a bit complicated. In vb6, it was ok, but with .net...ARGH ! When I put node via the graphic interface, I have that : tvListeParam.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("Node", New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("blublu"), New System.Windows.Forms.TreeNode("blublu"), New System.Windows.Forms.TreeNode("blublu")}), New System.Windows.Forms.TreeNode("Node", New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("blublu")})}) Is there a better way than this to create a treeview dynamically ? Thank you !
×
×
  • Create New...