For some buttons based on the user, we used to set previlege.for that we have 2 functions.
Our requirement is, we need to convert the toolbar to DLL. we converted the toolbar except the database-dependent function addbutton, visible button in the below example.
so after conversion we inherited the dll in a class called 'BaseToolBar'.
Now my problem is i can't use the class 'Basetoolbar' in another form.it prompt the error like can't create instance. but instead of Dll inherited class, if we inherited normal class it's working.
Kindly provide any solution for that
Imports Toolbar
Public Class BaseToolBar
Inherits UcBaseToolBar
Public Overrides Function AddButtons(ByVal ButtonNames() As String, Optional ByVal formname As String = "")
End Function
Public Overrides Function VisibleButtons(ByVal ButtonNames() As String, Optional ByVal formname As String = "", Optional ByVal mnuName As String = "")
End Function
End Class
In the above example,
1. Toolbar is the DLL we created
2.UcBaseToolBar is the usercontrol which is in DLL class.we inherited in 'BaseToolBar' class
3.Now where ever the tool bar used in forms , we need to replace with the class 'BaseToolBar' like the below
<usercontrol x:class="test" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:y ="clr-namespace:Toolbar;assembly=Toolbar"
xmlns:y1="clr-namespace:IT "
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<grid>
<y1:basetoolbar xmlns:y1="#unknown"></y1:basetoolbar>
</grid>
</usercontrol>
this <y1:basetoolbar xmlns:y1="#unknown">line creates error
Thanks & Regards
jai