|
Hi,
an Interface has a GetType() method, even in VB.NET
don't let Intellisense fool you (there may be a custom/all button that hides some).
|
|
|
|
|
thanks for ur answer
but anyway if i use like this ie interface.[gettype]() it shows an error that gettype is not a member of interface.
|
|
|
|
|
Imports System
Module Module1
Interface ISomething
Sub fDouble()
End Interface
Class Whatever
Implements ISomething
Sub fDouble() Implements ISomething.fDouble
Console.WriteLine("whatever")
End Sub
End Class
Sub Main()
Dim some As ISomething = New Whatever
Console.WriteLine(some.GetType().ToString())
Console.ReadLine()
End Sub
End Module
I suggest you buy an introductory book on VB.NET and study it...
|
|
|
|
|
Dear Experts ,
How to enable mdi menus at runtime depending upon the access rights to user after login.
I have a table in sql server 2000 as
select menuid from user_rights where userid = id
result : 1,3,5,10,15
now in mdi, in menustrip, for each toolstripmenuitem, i have mentioned a menuid in tag property.
I'm new to vb.net
Kindly advice , Thanks in Advance
|
|
|
|
|
You can use Condition statements.
|
|
|
|
|
in vb 6.0 what i used to do was like this :
If rs.State = 1 Then
rs.Close
End If
qry = "select menu_id from user_rights where user_id = '" & id & "' order by menu_id"
rs.Open qry, conn, adOpenDynamic, adLockOptimistic
While rs.EOF = False
For Each m In Me
If TypeOf m Is Menu Then
If Trim(m.HelpContextID) = rs(0) Then
m.Enabled = True
rs.MoveNext
End If
End If
Next
Wend
can i get to do something similar in vb.net 2005 ?
Thanks for reply
|
|
|
|
|
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & System.Windows.Forms.Application.StartupPath & "\phonebook.mdb;"
cn.Open()
Str = "select menu_id from user_rights where user_id = '" & id & "' order by menu_id"
rs.Open(Str, cn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
While rs.EOF = False
For Each m In Me
If TypeOf m Is Menu Then
If Trim(m.HelpContextID) = rs(0).Value Then
m.Enabled = True
rs.MoveNext
End If
End If
Next
Wend
What ever you gave I'll convert to vb.net with your same format
|
|
|
|
|
Ok,
i'm using vb.net 2005 and sql server 2000
i'll keep chking for ur reply.
Thanks a lot
|
|
|
|
|
I'm not able to find how to do this...!
I'll explain about the requirement..
i have a table in sql2000 which has col username and id(this id i want to match to tag property of toolstripmenuitem)
in vb.net2005, i have one menustrip in mdi, where for each toolstripmenuitem there is a tag number .
now i want to disable all the menuitems and subitems at first and then enable only those items which match the id as per the username in table .
I hope this is clear.
Kindly help !
|
|
|
|
|
How caan I read multiple rows using dr in vb.net having ms access as database?
|
|
|
|
|
You can loop through the DataReader and check for records.
While DataReader.Read()
|
|
|
|
|
Hello All,
Am developing small Employee Data Entry system For Our employees. am Using Vb.net and vb code for that, I want to Know some Picture capture techniq, ie in runtime i want to capture the employee Photo by a digital camera it should automatically Saved locally in that system. Is it possible through a picture box control. Please advice..
Thanks
Riz
|
|
|
|
|
You can look into WIA, it can be used to tell most cameras to take a pic. Or you can look at the Canon SDK and my wrapper class ( it's a CP article ), but in that case, you need to buy a camera on ebay, none of the supported cameras on the SDK version I worked with, are still commercially available.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
thanks For your speedy reply. would you please give me suggestion or website results for that cause am searching in wikipedia site for WIA, I dont get the meaning.Cause am using windows Vista OS in my system. How can i work with WIA through VB.net Can you suggest some thing like sample Programs etc. If possible please help me.
Thanks
|
|
|
|
|
Google for "Windows Image Acquisition".
|
|
|
|
|
What's[^] so hard about it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I am working at a project in VB.net where I have to populate a listview (detail) with names and different colors for each item (color depending on status of name)
The project is has to be a part of a program written in C#.
When I use my code in a program completly in VB.Net all works fine. I can see de wanted colors. But in the project that is part of the C# programm all I get is the color chosen in the properties of the listview.
Also the toolstripbar is in desingmode blue, but when I run the program it is the windowcolor.
Is there a setting in C# that makes that the coloring dosn't work ?
Thanks
|
|
|
|
|
I imagine you need to mark the box as owner drawn.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have 2 separate project, one running as console application and the other as window application. I need to combine both project so that i can use both function. How am i suppose to do it since both are different project type? Another question i have is that the window application project is a conversion from vb6, can it still operate as normal if i have combine the 2 project as i heard there is some limitation for activeX conversion file?
|
|
|
|
|
Subjugate wrote: I need to combine both project so that i can use both function
What you need to do is separate out the shared functionality into a Class Library and then reference the class library project in each of the other projects.
|
|
|
|
|
Sorry i don't really got what u mean as i never try something like this before. Is it possible to have a more detailed explanation? Sorry to be troublesome.
|
|
|
|
|
What Colin described is a basic concept of development, seperation of processes. If you have no idea of this then a forum question/answer is not going to help you, it is too brief. You need to get some education in this area, get a book and work through it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am not sure if this is what i should do. My application is kind of confusing. I am working on a server and client kind of relationship application. My client will send a request and my server will reply. The request is related to one of my external hardware, therefore both my server and client will have to have the same hardware interface. Currently i have already established the connection between the server and the client. I need to integrate my control application of my hardware to the client and server application. So i am a bit lost at the moment and not sure if i have lost track with my concept.
|
|
|
|
|
So you have a design problem. I presume the console app runs on the server and the winforms is the client app. Or maybe there is functionality that is required in both.
My suggestion. Identify the functionality in the 2 apps based on their location Server, Client or Both. Build a WCF service with the Server and Both functionality and a winforms app with Client and Both.
A service is basically a set of classes so seperate the Both functionality into it's own class so it can be included in the Client app as well as the service.
And yes I suggest you rewrite the entire solution as your current apps sound like crap and using a converted VB6 app is asking for trouble (this is why I know your solution is crap).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
AFAIK Windows is not capable of having a single EXE that runs as a console app under some circumstances and as a Windows app under other (such as the presence/absence of a command line switch). It seems MS made a rather unfortunate fundamental decision to that effect long time ago.
|
|
|
|