Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. Direct3D or DirectDraw? :)
  2. YOu would have to edit the constructor of your second form: 'a variable to store the instance Dim mainform As FormMain Public Sub New(ByVal form1 As FormMain) 'accept a form instance MyBase.New() InitializeComponents() mainform = form1 'set the passed in instance to the local variable Then in your second form you can use the mainform variable to access the instance that was passed in. And to declare your second form you need to do this: Dim editform As New FormEdit(Me) 'using Me becasuse Im assuming you call this from your FormMain
  3. You need to go through all controls on the form and look for the textbox: Dim ctrl As Control For Each ctrl in Me.Controls If TypeOf ctrl Is TextBox Then If ctrl.Name = "TextBox" & i Then 'do something to that textbox End If End If Next
  4. VS.NET generates a file named AssemblyInfo.vb to which you can input that information. If you dont have one then create a new project and just copy the file to your current one and fill in the info. Or add those imports: Imports System Imports System.Reflection Imports System.Runtime.InteropServices And then you can use this: <Assemlby: AssemblyTitle("")> There is more attributes that you can set. You can embed icons in your exe by adding them to the project and then setting their Build Action to Embedded Resource.
  5. In C# Item property is an indexer.
  6. There are some Regular Expression samples on GotDotNet: http://www.gotdotnet.com/community/usersamples/Default.aspx?query=regular%20expressions
  7. It works for me, what code are you using?
  8. Ah I see now. What happens is the TextChanged event fires before the instance of that form is set to that variable so the variable itself doesnt contain an instance yet. What you can do is add a TextChanged event handler to the TextBox dynamically after initialization is all done. What other people also use sometimes is a boolean value that will indicate whether the initialization is done and if not dont execute the code in the TextChanged event.
  9. Look into this namespace, it contains all you need including attachements: System.Web.Mail :)
  10. Can you show the exact code you have now?
  11. This part in your form2: Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub Change it to: Dim firstform As Form1 'variable that will hold the instance of the passed in form Public Sub New(ByVal f1 As Form1) 'accept an object of Form1 type MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call firstform = f1 'assign the passed in instance to a local variable End Sub Then from your second form you can reference your first one using the forstform variable, or whatever you want to call the variable. Then when you declare Form2 in your Form1 then do this: Dim f2 As New Form2(Me) This will pass in the current form to the constructor of Form2.
  12. In that case you wont have access to the SetStyle method of the ListBox.
  13. You dont have an inherited class for the ListBox?
  14. Go to your class which is the control, and insert this code: Public Sub New() SetStyle(ControlStyles.DoubleBuffer, True) SetStyle(ControlStyles.AllPaintingInWmPaint, True) SetStyle(ControlStyles.UserPaint, True) End Sub :)
  15. If you didnt create a Sub New in your class with the control, there shouldnt be already one. Are you by any chance looking at your form class?
  16. No, the error means that you dont have an instance of the Random object. Are you sure you have the New keyword when declaring your Random object?
  17. If your control class doesnt have a Sub New then simply create one and the code in it.
  18. Yeah, they are all located in System.XML namespace. The class you will probably use is XMLTextReader. Here are some good tutorials to get you started: http://samples.gotdotnet.com/quickstart/howto/default.aspx?url=/quickstart/howto/doc/Xml/OverviewofXML.aspx :)
  19. What line and what is the code you are using with what I showed you? If the rest is the same and you just added the declaration and used that object it should work. Here is what works: Dim rambo As Integer Dim x, y As Integer Dim dist(100) As Integer Dim r As New Random For x = 1 To 1000 rambo = r.Next(1, 100) dist(rambo) += 1 Next For y = 1 To 100 ListBox1.Items.Add(y & "-- " & dist(y)) Next
  20. Put in the control's constructor.
  21. You will get that error on the line you showed, Dispose method doesnt return anything so you cant assign the result of it to anyting because it simply doesnt return a result. :)
  22. Dont seed the random generator everytime. Try it like this: Dim r As New Random 'then for every number r.Next(1,100)
  23. Control class lets you use the SetStyle method of the control to set Double Buffering, AllPaintingInWMPaint and UserPaint to true. Those will make drawing faster and eliminate most of the flicker. And if you are using AllPaintingInWMPaint remeber to draw only in the paint event. Double buffering will cause all the painting to be first done in memory so the flicker is lowered.
  24. You would need to rewrite it under the .NET Compact Framework, and some things available for .NET Framework are not available to .NET Compact Framework.
  25. There is no shape control in .NET Framework, you have to draw shapes using GDI or GDI+. I dont agree that VB6 was easier to use, VB.NET is fully OOP which makes things so much easier than programming in VB6.
×
×
  • Create New...