Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. The best you could do is to optimize your program as much as you can. When you add event handlers shouldnt do any difference. Also did you try to run your application in the Release mode instead of Debug? The applications run faster under rlease mode.
  2. You the Convert class to do all kinds of conversions: System.Convert.ConversionYouWant(Values);
  3. mutant

    multiline

    First, dont use the old VB6 way of reading files, its slower then the new StreamReaders :). This will do it, using a StreamReader: OpenDialog1.ShowDialog() Dim reader as new IO.StreamReader(OpenDialog1.FileName) 'new stream reader object with the file name from the dialog TextBox1.Text = reader.ReadtoEnd() 'read the whole thing using 'ReadToEnd() method reader.Close() 'close the strea, :)
  4. You dont have to change much. Just change the event to handle the panel instead of the form: Handles Panel1.MouseMove And then when you create a graphics object use: Panel1.CreateGraphics() Instead of form's CreateGraphics method.
  5. Delphi is a RAD language like VB, but the syntax is more difficult and yes there are semicolons :). Yeah, it has a form designer. Delphi was made for Windows but with another tool from Borland you can compile your delphi program to run on Linux. And I think it actually costs more than VS.NET. Well you can develop for VB.NET for free with the SDK, Delphi is like VB6, the IDE is cobined with the compiler, so you would have to buy it. I didnt have much experience with Delphi but I can say that VB is better.
  6. It doesnt appear to be working. If you look at the link of the page numbers, its very different than the one that appears on other styles.... maybe thats the problem, I dont know :).
  7. Add your images to your project, click on the image in the solution explorer, then in properties window click on Build Action and then from the combo box at right choose Embedded Resource. To get the resource to use in your app do this: System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("ProjectNamespace.ResourceNameAnd Extension"); This will return a stream that will contain the resource you specified.
  8. It should work, it should empty the file right during the constructor. Are you sure you are checking the right file or things like that? To delete a file use the IO.File class: IO.File.Delete("path")
  9. Another overload of the StreamWriter constructor asks whether you wish to append to the file, just specify it to False. It will overwrite the file. Dim writer As New IO.StreamWriter("file path", False)
  10. You shouldnt have much problems porting your code to .NET, most of it should be easily portable. Yeah, just look at your code and rewrite as you go.
  11. If your application is big and it works all right then there should be no reason to migrate to .NET, if your app is small and you need the .NET functionality then you could rewrite it.
  12. You have to use the Cursor property of your form to set it. You would have to set the custom cursor from code as you cant do it in the designer. Me.Cursor = New System.Windows.Forms.Cursor("filename, stream or handle to the cursor")
  13. The quality of code produced by the wizard is not one of the best things you will see, Im pretty sure almost everyody on this forum would not recommend using it. :)
  14. The problem with closing the parent when the closing event of children is edited in not a really good feature of MDI apps. What you can do it create another public variable in your parent of boolean type and set it initially to False. Then in the closing event of the parent set it to true, and in the closing events of the children instead of hiding them right away do a check for value of that boolean variable on the parent. If its false then just hide it like you would do normally, if true then do nothing there.
  15. If you are using VB.NET standard the upgrade wizard is not available to you.
  16. That would work with a slight modification if you did what I said in my eariler post. When you show the dialog form from the parent pass in the reference to the parent into the ShowDialog method: modalform.ShowDialog(Me) Then you would do this in the modal form: Dim main As Form1 = Me.Owner main.input.MdiParent = Me.Owner main.input.Show() Or using casting: DirectCast(Me.Owner, Form1).input.MdiParent = Me.Owner DirectCast(Me.Owner, Form1).input.Show()
  17. :) Solution explorer is the little window on the right where you see all your project files, projects and things like that.
  18. Go to your Solution Explorer, right click on your project, select properties, on the left there should be a treeview, select Common Properties, then from the list select Build. It should be there.
  19. Im sorry, its supposed to be e.Cancel. Are you showing the dialog box from the parent? If you show it from the parent, when you show it with ShowDialog() pass in the parent as the owner of the ShowDialog(Me). THis way you can refer to the parent with the Owner property from the dialog.
  20. TO change the icon of your executable go to your project's properties, then in select the Common Properties on the left, and then the select Build from the list of options. To help you edit things like that VS.NET automatically creates a file named AssemblyInfo.vb which has place for you to put all that info.
  21. You could put this code in the Closing event of your child: e.Handled = True 'stop the closing Me.Hide() 'instead of closing, hide the form This way you will have only one instance of the form.
  22. So on exit of your frmMaint you create a new instance of your menu form and show it? What is your code on the button_click event handler? There shouldnt be another instance of frmMenu if you didnt create it yourself.
  23. What do you mean return? If you just used the code I showed you the Menu form would still be there visible, so if you close the frmMaint form you should still be able to see the Menu form.
  24. This is where the code I showed you before would work. Having one variable with an instance in the parent that all children can access, everytime you would call the Show() method of the instance that is stored in that variable it would show only that form, it wouldnt create a new instance. Other way would be too go through all the form in MDIChildren collection like you mentioned and check what form it is: Dim f as Form For Each f in Me.MdiChildren 'Me here refers to the parent, if calling from child 'form use Me.MdiParent.MdiChildren If TypeOf f Is SomeFormClass Then 'form of the type already opened End If Next The first thing would give you more control over all this, then checking for the form type in the child collection.
  25. Then use this: Dim fMaint As New frmMaint 'of course you call the variable something else than fMaint fMaint.Show() You use frmMaint becuase thats name of the your form class. :)
×
×
  • Create New...