|
-
Jan 26th, 2003, 10:14 PM
#1
Thread Starter
Sleep mode
type of an object
How can I know the data type of an object in general ? I tried GetType but with no luck !
as an example
system.Activator (there are million of objects ....)
thanx for any help ?
-
Jan 26th, 2003, 11:33 PM
#2
would something like this work?
If myObject.GetType Is GetType(PictureBox) Then blah
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jan 26th, 2003, 11:41 PM
#3
Thread Starter
Sleep mode
"Object Reference not set to an instance of an object "
It must be more complicated than this
-
Jan 26th, 2003, 11:45 PM
#4
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jan 27th, 2003, 12:05 AM
#5
Thread Starter
Sleep mode
Originally posted by MrPolite
well then set it to something! 
yeah you're right, you cant' check the object type with GetType if it's set to Nothing.... but would you really wanna check an object type if it's null?
maybe I need so .anyways , I tried this but same error
VB Code:
Dim myobject As Object
If myobject.GetType Is GetType(TextBox) Then
MsgBox("your object is " & myobject).ToString()
End If
-
Jan 27th, 2003, 12:06 AM
#6
Originally posted by pirate
maybe I need so .anyways , I tried this but same error
VB Code:
Dim myobject As Object
If myobject.GetType Is GetType(TextBox) Then
MsgBox("your object is " & myobject).ToString()
End If
well I tried this and it worked:
dim pic as new picturebox
if pic.gettype() is gettype(picturebox) then msgbox "BOO"
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jan 27th, 2003, 12:12 AM
#7
Thread Starter
Sleep mode
Well this works but return nothing without type name ??empty space what's wrong
VB Code:
Dim myobject As Object
Dim txt As New TextBox()
If txt.GetType Is GetType(TextBox) Then
MsgBox("your object is " & myobject).ToString()
End If
-
Jan 27th, 2003, 12:18 AM
#8
Originally posted by pirate
Well this works but return nothing without type name ??empty space what's wrong
VB Code:
Dim myobject As Object
Dim txt As New TextBox()
If txt.GetType Is GetType(TextBox) Then
MsgBox("your object is " & myobject).ToString()
End If
eeh I dont know what you're trying to do. What's myObject doing there?
is this what you want?
VB Code:
Dim txt As New TextBox()
If txt.GetType Is GetType(TextBox) Then
MsgBox(txt.GetType.Name)
End If
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jan 27th, 2003, 12:22 AM
#9
Thread Starter
Sleep mode
I forgot to delete "myobject"
Thanx , it's working .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|