Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. Oh, you mean tab controls. It wont contain the tabs as they belong to the tabcontrol, not the form. I thought you meant that you need recursion for every control thats not a container. You only need recursion for those that have their own child controls.
  2. Me.Controls contains all controls on the form :)
  3. You dont need error trapping for that, simple use the IO.File.Exist method and if the file doesnt exist show the OpenFIleDialog. Look into the Microsoft.Win32.RegistryKey class for working with registry.
  4. And if you use what georg showed you and you want to access them later with code use this: Dim ctrl As Control For Each ctrl In Me.Controls If TypeOf ctrl Is ComboBox If ctrl.Name = "Combo1" 'or whatever number and name you set to it 'Do something to the combobox End If End If Next
  5. Or :), if you want to run it like a normal application use this in your Sub Main: Application.Run(New Form1) 'or whatever your form is called This will start the message loop for your application. :)
  6. Now you use this instead of app.path: Applicatoin.ExecutablePath :)
  7. What is the problem you are having with it?
  8. Edit the form constructor. If the form1 is the one you open first, leave it like it is and edit the constructor of the second one so it accepts a form instance as an argument, like this: 'this in your second form Dim firstform As Form1 'variable to hold an instance of the first 'form that will be available to the whole class Public Sub New(ByVal frm As Form1) 'accept an instance of the form MyBase.New() InitializeComponent() firstform = frm 'assign the passed in instance to the variable that can 'be accessed in whole class End Sub Then you just access form with firstform.TextBox1.Text = "something" or however you want to call it. :)
  9. Try..Catch block is so much better then that, I suggest you look into that kind of error handling.
  10. You would have to draw the button yourself with GDI+, inherit a class from a button and then draw it in the Paint method or OnPaint Override. Or, just look on the internet for some already made ones :).
  11. It supposed to be Io.File.Exist not textfile.Exists like you just said, and what I showed you works. You dont need to declare any variable as the File class has shared methods. :)
  12. What you are doing is setting those flags for the form you have the code in, not the one that shows skins. :) You have to edit the class of the form that shows the skin. :)
  13. You can do it only in the form itself. So maybe you could edit the constuctor of the form that shows the skin or put in Load event, but you have to do it in the form itself, cant do it from another class.
  14. I was talking about C# and VB.NET :D
  15. I personally think having only one language with a group of developers is better then having 2. Everything goes most smoothly becuase you dont have to convert code from one to another just to see excetly how it works. I suggest everyone from your workplace gets together you talk about moving to the preferred language. :)
  16. You could also talk to your boss about moving to VB.NET instead of C# as I think he would think about that more becuase from what you say it seems he likes VB6. :)
  17. The example dynamic_sysop gave you fits perfectly into your case :) If Io.File.Exists("C:\test.txt") Then Dim sr As IO.StreamReader = New IO.StreamReader(New IO.FileStream("C:\test.txt", IO.FileMode.Open)) dim a as String = sr.ReadToEnd() sr.close() Else 'File does not exit, exit the sub or whatever you want to do End If
  18. Thats another way :), but if you use what Divil said make sure that you disable the maximizebox so the user cant maximize it, that is of course if you dont want the user to maximize it.
  19. Change the declaration of numbers() to: Dim numbers As String = filetext.Substring(ppistart + 10, 5) 'then convert the string to a number Convert.ToInt32(numbers) Then convert the string to a number.
  20. To make controls run at the server you simply put: Runat = "Server" In the control's tag.
  21. Use the MinimumSize and MaximumSize properties of the form, just type the same number in both.
  22. Dim reader As New IO.StreamReader("pathtofile") Dim filetext As String = reader.ReadToEnd() Dim ppistart As Integer = filetext.IndexOf("PPI") + 3 'add 3 becuase 'the word is 3 letter long so we get the number right after the word Dim numbers() As Char = filetext.Substring(ppistart + 10, 5) 'start at 10 positions after "PPI" was found, and get next 5 characters reader.Close() The numbers() array will now contain all the 5 numbers 10-15. You should use those methods of the string instead of the ones dynamic_sysop showed you.
  23. You could declare it without an instance where all subs and functions can access it and then in the newdoc sub just create an instance from that variable, it will accessible to all subs and functions in the class.
  24. Declare your form as new on the top of your class, then from where ever you are calling just call it as FormName.Show() It will keep calling the same instance.
  25. I didnt know what in the world was Amzi KnowledgeWright :), but I typed it in google and I think I got to the product's site and it says the latest version supports .NET. Next time please say what you are talking about :)
×
×
  • Create New...