Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. Modules are not the best way to go in VB.NET, classes with shared members are more fit in the .NET world. Pass the form's instance to the module's method that will do what you want. 'in your module Public Sub DoSomthing(byval f as FormType) 'do something End Sub Then when you call the method from your form, do this: DoSomething(me) Then you will be able to access the instance you passed.
  2. mutant

    Mesh / PMesh

    If a mesh is progressive it means that the level of detail of the mesh is automatically adjusted based on how far from the camera the mesh is. For example, you have a ultra detailed mesh, but if its far from the camera the details won't be noticable and it will only eat up processing time, but with progressive meshes, the number of vertices is decraesed. Thus making the mesh less detailed which isnt noticable anyway from afar.
  3. mutant

    Mesh / PMesh

    Do you mean Progressive Mesh?
  4. Are you showing that form modally? If yes when using the ShowDialog method pass in your main form as an owner of the dialog and when working in your second form you will be able to access the main form using the Owner property. If not, what you could do is edit your settings form's constructor to accept an instance of the main form and assign it to a local variable in your settings form and access the main form from that variable.
  5. See this thread: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=72201 :)
  6. If it is created then you would have to keep the reference to the instance of that form in a variable and then use the Show method with that variable.
  7. You need to create an instance of your form first: Dim frmName As New SomeFormType frmName.Show()
  8. If you want to pass a string back to the form1, you need to have some variable that will hold that string. So yes, you must create a new variable in your Form1, FName like you said. But do not make it private so you can access it from Form2 (unless you want to make use of properties), and also do not declare it within any method, just declare it so its availabe to the other form.
  9. Hello was used as just an example :). Replace hello with the name of your string. :)
  10. If you are passing in the instance in the ShowDialog method then you can later use th Owner property from your second form. SO before you close form2 do this for example: Form1 parent = (Form1)this.Owner; //set a stringv alue to something parent.hello = "Hello";
  11. Creating a new instance like you are doing in your code won't work as I said before. So you tried Me.Close() right? If the form you are closing is the application startup form then closing it will exit the application loop, and if the application loop is exited so is the application. You could Hide() the from instead of closing it.
  12. Is the frmMain a form that is currently open and you wish to close it? Your current code creates a new instance of the frmMain form, so no other form will be affected by you calling the Close method on the form, but that instance.
  13. If the only thing your file would contain is the folder path you can easily do it using IO.StreamReader class. If your file will contain more info then you will need to do some searching for the path. 'create a new stream reader so you can read the file Dim reader As New IO.StreamReader("path to the file") 'store path somewhere, this is assuming you have one thing in a file like I said before 'read it using the ReadLine method which will get the whole line for you dim folderpath as string = reader.ReadLine() reader.Close() :)
  14. So what is the problem you are having? How to create a new form with the settings provided by the user? Im not sure because you really didn't state what the problem is (or I didn't find that :)). If you have trouble creating a form from user settings, give some example of how those settings look like. Calling multiple levels of forms is not hard, simply add a Show method call to a form and you can show however many forms you want.
  15. For your first question. I would say a better approach is the first one. Since the instance of the TextureLoader is public, why not let it handle its own business. You don't want one class to handle everything just by setting up methods that simply forward to another method. You could padd the device through a constructor to the TextureLoader. That is how a lot of Direct3D objects get a reference to a device when they need it.
  16. There was nothing new to DirectDraw since version 7 so I would guess that Microsoft doesn't care much for it anymore. I wouldn't say not use it since its available. I don't know what backward compatibility would managed DirectDraw have since there was no eariler version for DirectDraw under .NET than with DirectX9 :).
  17. If I'm understanding your problem correctly then the solution presented by FartNocker should work for you.
  18. Well, first you have to make a choice. Pass form instances through constructors, setting up a property maybe,or show your setting form modally, which means that your main application won't respond until the form shown modally is dealt with. :)
  19. If all you are trying to do is see if items match on two listboxes then that is too much code :). Here is how you can do it: (Im assuming that both Listboxes have the same amount of items, if not correct me) For x As Integer = 0 To lstSelected.Items.Count - 1 If lstSelected.Items.Item(x) = lstSelect.Items.Item(x) Then MessageBox.Show("Cannot process") End If Next
  20. Or, if you are using .NET Framework 1.1 use the System.Windows.FolderBrowserDialog class.
  21. You need the instance of the parent form. You can't just access a form instance using its class name. What you could do is pass the instance of your parent form to your settings form using constructors. Or if you are using the settings form modally, use constructor wihich accepts a form instance as a paramenter, and then from your setting form use the Owner property to access the parent form.
  22. Trying to copy it like that won't work because all your label are essentially set to one label instance, they all will have the same handle, etc. so what you are doing is creating label objects that refer to one instance of the label therefore each time you try to add a label you actually modify the only label instance you have. And it doesn't matter if you added it before, same instance of the same control will not be added twice to the panel, therefore you only see one label.
  23. If you don't set their location they all will end up in the default location therefore overlapping. [edit]Ah, sorry. Misread your post.[/edit]
  24. You can't reference forms from another project unless that other project is a DLL.
  25. Ah, :) I would guess that most professional 2D graphics designers use Photoshop. Its the most popular program for that. There are others like PaintShop Pro or Macromedia Fireworks, but they are not as widely used but from what I heard still good.
×
×
  • Create New...