 |
|
 |
Hi Daniel, your code is really great.. I've tried to look around many site but didn't found article like this one.. this really like what I want to develop.. But can you please help me convert this code into c#, cause I'm c# developer n really bad on VB..
Regards,
Andy.
|
|
|
|
 |
|
 |
Thanks Daniel for this job , but it seems we have privilege setting per menu , what if we want to give user the permission per action?
suppose we do have a "Customer Management" menu in which the C.R.U.D actions are happening and we want to let user "x" just do the "Create New Customer" action !
|
|
|
|
 |
|
 |
Hi Daniel...
i am looking for same example in c#...
do u have it..
i already tried but fell to convert.
my email id is chandravadan_patil@rediffmail.com
|
|
|
|
 |
|
 |
Anybody I can tell me another example dynamic based on databes i will like to compare with anothers examples, i need urgent
|
|
|
|
 |
|
 |
Hi,
I really didn't find then, and that's the reason I wrote this code.
But I guess I was not worry about performance or to handle many users.
I am sure it is easy to come up with a smarter and faster code.
Daniel
|
|
|
|
 |
|
 |
Hi,
Thanks for this code. I have further modified this code to use with MenuStrips and have added column for Shortcut-keys.
Whenever I find time will update the menustrip code along with shortcut key creation.
Kuldip
|
|
|
|
 |
|
 |
can you put an example on runing a function on this?
|
|
|
|
 |
|
 |
It is really not so simple. I did not find a better way to do that than to call with the Activator class. Look it up at the MSDN.
regards,
Daniel
|
|
|
|
 |
|
 |
The code looks great and is exactly what I need but I want to able to call a form when the user clicks and option. Great if you can give a code to do that.
Thanks,
Thomas
|
|
|
|
 |
|
 |
"Dear Mr. Daniel Presman, could you send me the source code of the menu we did, so I am getting trouble to implement your articles. I keep hearing from you."
- Siras
|
|
|
|
 |
|
 |
I didn´t understand your request. Can you be more specific?
regards,
Daniel
Sean Ewington wrote: Dear Mr. Daniel Presman, could you send me the source code of the menu we did, so I am getting trouble to implement your articles. I keep hearing from you."
|
|
|
|
 |
|
 |
Hi Daniel,
I have doubt in menus...,
i used javascript menus in my forms...,
in that users are having different rights,
means some of the user dont have rights to access some menus,
i given each forms have pageno(its the flag),
now when the user enter his userid & pwd,
based on his rights that menus want to display...,
i tried lot,i didnt get solution,
i saw ur article, abt Dynamic based on menu bars,
its some what similar to my probs,
so plz help me to solve my probs
regards,
Magi
|
|
|
|
 |
|
 |
I guess you an go 2 ways:
1 - Make a similar solution as this one (I mean a database to implement the menu)
2 - (this is more simple) If you have 2, 3, 5 or even 10 or 20 types of user you could have a var to set which type of user is this one and which menu he should get.
Hope this helps,
Daniel
|
|
|
|
 |
|
 |
Hi
i have this menu but how can i get value of funcToCall as code?
I mean i have a value form1.show() in funToCall. now how can i run form1.show()??
Dim funcToCall As String
funcToCall = HashFunctions(position)
MsgBox(funcToCall)
'here you should place a SELECT CASE (funcToCall)
'or call a function to do that
'to execute the right function for each call
|
|
|
|
 |
|
|
 |
|
 |
when i click the button after entered user id and password i got error in this else part
If sel_key.LastIndexOf(".") >= 0 Then
sel_KeyParent = sel_key.Substring(0, sel_key.LastIndexOf("."))
parentItem = HashMenu(sel_KeyParent)
parentMenu = parentItem.MenuItemobj
parentMenu.MenuItems.Add(sonMenu)
Else
Me.Menu.MenuItems.Add(sonMenu) End If
error : {"Object reference not set to an instance of an object."}
please any one help to correct the error
vinothkumar.R
|
|
|
|
 |
|
 |
I like the most your sample. Is very simple and easy to understandand.
I would like to see a sample of security based on your model using the SQL Server,
the email and password is like loginname and password, but I would like you share with Us a model.
all the people could make their own requested changes.
Another good tip could be, one to many in windows form. I would like to know how to make (add, delete, change, print) of an Envoice model made in Windows form.
There is a lot of samples made in web, but not in Windows Forms.
Can anybody share this tip with Us?
hava7171
|
|
|
|
 |
|
 |
I have download the sample and I didnt see the database.
When I run the sample, any database is in the folder decompresed.
Did you put DB in your sample?
hava7171
|
|
|
|
 |
|
 |
Hi,
There is a Database in the demo files it is named menu.mdb and it is an access database.
This db is only an example. You can of course use Sql or other db you prefer with this code.
The file is in the \bin folder.
Daniel
|
|
|
|
 |
|
 |
Hi Daniel Presman!
I readed your's code a bout menu dynamic. But I understand the example how do works when i want to change other user.
I try change user, then click fill It happened error:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
If sel_key.LastIndexOf(".") >= 0 Then
sel_KeyParent = sel_key.Substring(0, sel_key.LastIndexOf("."))
parentItem = HashMenu(sel_KeyParent)
parentMenu = parentItem.MenuItemobj
parentMenu.MenuItems.Add(sonMenu) Else
Me.MainMenu.MenuItems.Add(sonMenu)
parentMenu = sonMenu
End If
Thanks !
like vb.net very much, but i'm begining studieds vb.net
|
|
|
|
 |
|
 |
I guess you should have to clear all hashtables before changing user.
When I wrote the code to this example, it was a simple exmaple and I did not think about changing user.
Try doing that, Ihope it will work.
Daniel
|
|
|
|
 |
|
 |
Thank you for your about
However,I tried your's suggest:
In Private Sub cmdGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGo.Click
I've add code by two the way:
+ The fisrt:I Add code: Dim nCount As Integer
Dim i As Integer
nCount = Me.MainMenu.MenuItems.Count()
If nCount > 0 Then
For i = nCount - 1 To 0 Step -1
Me.MainMenu.MenuItems.Remove(Me.MainMenu.MenuItems.Item(i))
Next
End if
If LoadUserPerms() = False Then
MsgBox("Username or Password are incorrect")
Else
LoadMenuItems()
End If
End Sub
It work have happen error which i send to you
The two way I add Code
HashFunctions.Clear()
If LoadUserPerms() = False Then
MsgBox("Username or Password are incorrect")
Else
LoadMenuItems()
End If
It work have happen error:
If sel_key.LastIndexOf(".") >= 0 Then
sel_KeyParent = sel_key.Substring(0, sel_key.LastIndexOf"."))
parentItem = HashMenu(sel_KeyParent)
parentMenu = parentItem.MenuItemobj
parentMenu.MenuItems.Add(sonMenu)
Else
Me.MainMenu.MenuItems.Add(sonMenu)
parentMenu = sonMenu
End If
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
I hope that you can help me.
Thanks!
like vb.net very much, but i'm begining studieds vb.net
|
|
|
|
 |
|
 |
I guess, that in order to change user You should clean every object.
This is a short code to clean the menu and build a new one with a new username:
'Clean the previous menu items and hashtables
MainMenu.MenuItems.Clear()
HashFunctions.Clear()
HashMenu.Clear()
'select user parameters from the database
'(since I am sure there is a user 1 and 2 I am not checking
' here if it exists, but you should check)
Dim adap As New OleDb.OleDbDataAdapter("", conn)
adap.SelectCommand.CommandText = "SELECT * FROM ITEMS INNER JOIN PERMS ON PERMS.ID_ITEM = ITEMS.ID_ITEM WHERE ID_USER =" & user_id
dsUser.Clear()
adap.Fill(dsUser)
'Load new menu items to main menu
LoadMenuItems()
Hope this helps,
Daniel
|
|
|
|
 |
|
 |
Hi !Daniel Presman
Thank you very much, I tried examples, it worked right. I'm researching how call function or call *.dll, and drawing icon for items.
I hope that, if i have trouble you will help me.
Sorry,my English very bad so that if i talk to you, you can't understand my verbalision. I hope that with the time my English is improving and i can to explain
Thanks,
Goog Luck!
like vb.net very much, but i'm begining studieds vb.net
|
|
|
|
 |
|
 |
I've try the dynamic nemu but i have a problem :
* In my ITEM - table :
name - hearar - text
-----------------------------
Master - 0 - Master
Polis - 0.1 - Polis
member - 0.2 - Member
Underwritng - 1 - UNDERWITTING
Claim - 2 - Claim
Finance - 3 - Finance
Report - 4 - Report
Utility - 5 - Utility
Exit - 6 - Exit
But when I run the programme, output of menu is :
Master Underwriting exit Report Utility
According the number of hearar what I want is :
Master Underwriting Report Utility Exit
How can I have the menu text index that I want,.. is there any solution... help me please..
|
|
|
|
 |