Jump to content
Xtreme .Net Talk

DR00ME

Avatar/Signature
  • Posts

    174
  • Joined

  • Last visited

Everything posted by DR00ME

  1. seems like you have really tested it... and i got it to work with empty project.... I have to think how to modify it for my own classes... I think I did something wrong because my class names are a bit dodgy...
  2. Im sure you have nice thoughts but it is a bit confusing for me because it is in c sharp format... :) thx anyway ( I know it is basically same as vb.net but to me it is a bit confusing ) and I havnt really used child classes at all...
  3. lol, I wish it would be that simple :D I know what robby means but I cant separate anything from my main class (AIvision)....
  4. so lets say form class would be class3.... so class2 inherits class1...and class1 inherits class3.... BUT does this mean that class2 inherits class3 because class1 inherited class3....? I mean if 2 classes inherit one(the same one).... does it mean the 2 classes inherit automatically each other too? do they have a connection ?
  5. Ok, I think you misunderstood me ? I mean I want to control class1 labels from my class2 sub programs...without inheriting the whole class1
  6. I got class1 and class2....there is one sub program inside the class2... the program is using class1 public shared variables... there are many variables the class2 sub program is using from class1... I dont want to use the class1 variables like: class1.this, class1.that ..I would like to find a better solution.... if i put 'inherits class1' everything works.... but the problem is I dont want to inherit the whole damn class1 and its FORM... so is there a simpler way to do it like inheriting a part of the class ?
  7. Actually I mean frm. cant find the label...
  8. DR00ME

    MyClass

    Thank you, yes it works now... but why it works now ?
  9. DR00ME

    MyClass

    MyClass.GetType.Assembly
  10. Public frm As Form1 Public Sub New(ByVal f As Form1) frm = f End Sub Public Sub setLabel(ByVal strText As String) frm.Label1.Text = strText End Sub it doesnt let me write frm.label1 because there isnt such a thing as frm because it is not set ?
  11. oh yeah thx very much... Im bad with these "new" statements...
  12. DR00ME

    MyClass

    Public Shared Sub Talk(ByVal WavToPlay As String) Try Dim WaveStream As Stream Dim oAssembly As Reflection.Assembly = MyClass.GetType.Assembly Dim nSpace As String = oAssembly.GetName.Name.ToString Dim WaveByteArray() As Byte WaveStream = oAssembly.GetManifestResourceStream(nSpace + "." + WavToPlay + ".wav") ReDim WaveByteArray(CInt(WaveStream.Length)) WaveStream.Read(WaveByteArray, 0, CInt(WaveStream.Length)) PlaySound(WaveByteArray, IntPtr.Zero, SND_ASYNC Or SND_MEMORY) Catch ex As Exception MsgBox(ex.ToString) End Try End Sub when I changed the sub program to PUBLIC SHARED it started to whine about "MyClass"... "Myclass is valid only within an instance method" ...when I put my baseclass name there it is whining again but this time : "reference to a non-shared member requires an object reference" ...so what should I do.... I need to use this sub proggy from a another class....
  13. How do I make a label Public shared so I could use it from another class....?
  14. DR00ME

    Conversion

    that's right... lol sorry for this dumb question...
  15. DR00ME

    Conversion

    So how do I convert a classlibrary to a DLL ? :rolleyes:
  16. The old one was way better... :eek: well but once the tag-system is back to online I have to reconsider...!
  17. Dim lol as byte '0-255 Try For Each myname In names Private Sub MyLovelyClass_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyPress If e.KeyCode = Keys.Escape Then lol = 1337 'causes an overflow exception End If End Sub Next myname catch ex as exception end try I think my ideas are mad atm... can someone help maybe ?
  18. Dim flag as boolean = false For each myname in names Private Sub MyLovelyClass_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyPress If e.KeyCode = Keys.Escape Then flag = true End If End Sub if flag = true then Exit end if Next myname lol try this.... I have no idea if it works.. now I wonder if it exits the IF END IF or the for loop... ack... You could also try to put the private sub outside of the for each loop.... I got an new idea... how about if you cause an exception and exit the code with it ?
  19. Umm, I'm not sure if I understand what you want but erm.... If you press ESC it will press btnStop on your form... Private Sub MyLovelyClass_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyPress If e.KeyCode = Keys.Escape Then btnStop.PerformClick() End If End Sub how is this ?
  20. DR00ME

    Uint32

    Ok thx I think I'll stick with the old fashioned way!
  21. I'm not sure but this is what I came up fast.... Private Sub MyLovelyClass_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyPress If e.KeyCode = Keys.Escape Then MyBooleanVariable = False End If End Sub Do While (MyBooleanVariable=True) 'This is your loop Enddo ack... I think this doesnt work because it is busy in the loop maybe... damn my head is mixed up because I used to code in Atmel and it was kind of statemachine coding...
  22. DR00ME

    Uint32

    Well some of my application variables are using values from 0 to ~ 80000 ...and I was thinking if Uint16 would take less memory than Integer.... what do you think ?
  23. Maybe this little example helps ? the private sub could be also _KeyPress or _KeyDown. What kind of running code would you like to halt ? [Vb]Private Sub MyLovelyClass_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp If e.KeyCode = Keys.Escape Then 'Put the running "code" stopper inside here End If End Sub[/code]
  24. DR00ME

    Uint32

    what's max and min values of this variable type ?
  25. yo, what kind of list/table/collection/array I should use to store keys as string and values as integer....also there should be a method for finding min and max VALUES... truely yours....
×
×
  • Create New...