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
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
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.
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.
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.
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
:)
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
:)
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
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.
:)
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.
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.
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.