|
Hi i have tried menubars in my form,
i got the solution........,
But now i need that menubars want to display based on the user rights...,
if he dont have rights for some menus that wont display,when he logged on in that time,
i tried that probs using some flags....,
but i didnt get solution....,
anyone plz help me......,
i need that codes........,
Regards,
Magesh
Magesh
|
|
|
|
|
not work with flags?, can you show me the code?, you systems must check the username, set flags to this users and enabled/unabled menus.
|
|
|
|
|
Hi used javascript and displayed menubars in my form..,
See each menu have submenus...,
i given for each form pageno(its the flag)...,
my ques is very critical,
take eg like..
two menus are there...,
in that two menus have 3,3 submenus..,
now one user can access in that first menu 2 forms and second menu 1 form....,
another can access in first menu 3 forms and second menu two forms...,
now how u can tell...,in that login page these are the forms menus only want to display like......,
regards,
Magesh
|
|
|
|
|
Sorry,
Are you looking for VB6 or VB.NET solution?
Sounds like you should have the access rights setup for a users group and check with IsInRole method of a WindowsPrincipal object. Is that the path you like to take?
Jelle
|
|
|
|
|
Hi i am using vb.net....,
Using javascript i displayed menubars in my form,
now i want to dispaly the menubars based on the user rights...,
If u know plz send me the code........,
Magesh
|
|
|
|
|
So VB.NET it is.
I do not understand the rest of your comments.
I would build the menu's in full form and not enable the items that an UserGroup can not use or hid the menu item altogether if that is preferred. For doing so:
You can decorate you menu creation with;
'Get a WindowsIdentity object for the current user. NameSpace: System.Security.Principal<br />
Dim currentIdentity as WindowsIdentity = WindowsIdentity.GetCurrent()<br />
'The WindowsPrincipal class can give access to the user's group memberships<br />
Dim currentPrincipal as WindowsPrincipal = New WindowsPrincipal(currentIdentity)
And use the following to test if menu items should be "not enabled" or "hidden".
if currentPrincipal.IsInRole("DOMAIN/Group Name") Then ' substitute DOMAIN and Group Name<br />
'Do your menu item setting<br />
End if
Clean up you objects. IsInRole can to with a Try block.
I hope it is something like this you are after. Else I possibly can do with some code.
Jelle
|
|
|
|
|
asp.net not work with javascript (directly), maybe you should enabled/unabled these menus with javascript and not with asp.net, this menus will be layers, with javascript activate this layers, the flags must take yours values from asp by strings or cookies and then activate the layers.
|
|
|
|
|
Create a project, add a simple class that implements System.ComponentModel.INotifyPropertyChanged, add a couple of string properties to the class. Now add a binding source to the form, and bind it to an instance of the class.
Now add text boxes and bind them to the properties of the class, also add a button.
In the Form Load event create an instance of your class and set the binding datasource to the instance of the class
In a button click event handler return the values of the databound properties by using:
ctype(Me.BindingContext(BindingSource1, "myPropertyname1").Current, String)
build and execute
DO NOT CHANGE THE VALUES IN THE TEXTBOXES
What does the code (from above)return...
For me it returns only the 1st Char of each of the bound properties!
Now alter the contents of the text box(es) and hey presto it will now return the whole string value.
Is it me?
Am i doing something wrong?
Help!
Below is some sample code for what i mean:
THE CLASS:
Public Class Fruit
Implements System.ComponentModel.INotifyPropertyChanged
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Private Sub NotifyPropertyChanged(ByVal info As String)
RaiseEvent PropertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(info))
End Sub
Private idValue As Guid = Guid.NewGuid()
Private strPlums As String
Private strApples As String
Private strPears As String
Private Sub New()
Plums = "None"
Apples = "None"
Pears = "None"
End Sub
Public Shared Function CreateNewFruit() As Fruit
Return New Fruit
End Function
Public ReadOnly Property ID() As Guid ' Psuedo key Value
Get
Return Me.idValue
End Get
End Property
Public Property Plums() As String
Get
Return Me.strPlums
End Get
Set(ByVal value As String)
Me.strPlums = value
NotifyPropertyChanged("Plums")
End Set
End Property
Public Property Apples() As String
Get
Return Me.strApples
End Get
Set(ByVal value As String)
Me.strApples = value
NotifyPropertyChanged("Apples")
End Set
End Property
Public Property Pears() As String
Get
Return Me.strPears
End Get
Set(ByVal value As String)
Me.strPears = value
NotifyPropertyChanged("Pears")
End Set
End Property
End Class
THE FORM:
Public Class Form1
Public WithEvents Fruits As Fruit
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Fruits = Fruit.CreateNewFruit
With Fruits
.Apples = "Bramley"
.Pears = "Conference"
.Plums = "Victoria"
End With
BindingSource1.DataSource = Fruits
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strNowPlums As String
Dim strNowApples As String
Dim strNowPears As String
strNowPlums = CType(Me.BindingContext(BindingSource1, "Plums").Current, String)
strNowApples = CType(Me.BindingContext(BindingSource1, "Apples").Current, String)
strNowPears = CType(Me.BindingContext(BindingSource1, "Pears").Current, String)
Label1.Text = strNowPlums
Label2.Text = strNowApples
Label3.Text = strNowPears
' The labels will show 'V', 'B', and 'C' but if you manually change the textboxes and click again it works properly!!
End Sub
End Class
|
|
|
|
|
I really happy for the respond.Thanks and God bless.
Demola.
|
|
|
|
|
|
i want to attach a flash file in vb.net form. i hav followed the folling procedure
first added shockwave object then
Place the Flash MX file in bin folder of the project.
Now double click on the form and write code on form load event
Button1.Text = "Play"
double click on the button and wrilte the following code on the Button1_Click event
AxShockwaveFlash1.Stop()
AxShockwaveFlash1.Movie = Application.StartupPath & "\segment1.swf"
AxShockwaveFlash1.Play()
this code is not working,plz tel me exact code
|
|
|
|
|
' TableName.RelationName.ColumnName string.
TextBox1.DataBindings.Add("Text", ds, "A.a_to_b.ColName")
I do understand the binding cenario above where a parent
table points out child records.
But I want to bind the other way around!
ds.Relations.Add("A_to_B", _
ds.Tables("A").Columns("ID"), _
ds.Tables("B").Columns("A_ID"))
BindingContext(ds.Tables("B")).Position
TextBox1.DataBindings.Add("Text", ds, "B.a_to_b.ColName")
Is this not possible?
Johan Svensson
|
|
|
|
|
I have a form for which I have changed the Appearance properties such as
BackColor : White (Palette)
FillColor : Black (Palette)
ForeColor : Black (Palette)
I have a 'Ok' command button on the form. I want the command button to be White with black font on it. For that I made the following changes
BackColor : White (Palette)
MaskColor : White (Palette)
But it still shows the button as windows color (grey). Is there some way to make it white or transparent atleast?
Can anyone please tell me what am I missing out to make the command button appear white with black 'Ok' on it.
|
|
|
|
|
hi folks!
I am developinng Window application with VWD Express. I have a database with this window application.
What I am trying to do is save information to the database of the application (thru code-behind). However, when I am connecting to database, I realize that I need ConnectionString. In Web application, connection string is determined in web.config. How we determine connection string in window application?
Many many thanks in advanced for the help and time!!!
www.thesemplice.com
|
|
|
|
|
I am sorry, I meant to say that I developed the application with Visual Basic Express Edition.
Thanks!
www.thesemplice.com
|
|
|
|
|
thesemplice wrote: In Web application, connection string is determined in web.config. How we determine connection string in window application?
Well, the IDE guides you to use web.config - there is no requirement to use that.
In a windows application, I'd suggest the app.config.
|
|
|
|
|
|
Thanks for all the replies. Colin was right, it is in the app.config.
Dave also reminded me about ConnectionStrings.com. I just thought about it and will look at it.
Thanks all!
www.thesemplice.com
|
|
|
|
|
actually i have to retrieve the date and time from the system whenever user logins....
i mean whenever he logins, that time and date should be stored in back end...
i am ok with connectivity and all that stuff, but having no idea hw to retrieve date nad time from the system...
can anybody help in idea...
if anybody could provide code, that will be highly appreciable...
thanks...
|
|
|
|
|
On login:
<br />
Dim yourString as String<br />
yourstring = datetime.now
This will give exacte date and time at the instance of a login.
Posted by The ANZAC
|
|
|
|
|
thanks anzac ....
regards...
|
|
|
|
|
hi i am doing a vb.net application in that i am using panels
wat i want is shrinking and expanding the pannel while program is in running mode
with regards
Balagurunathan.B
|
|
|
|
|
Could you clarify what you want? Do you want to give the user the option of sizing them, should they resize with the form. If you just want them to get bigger or smaller when the form changes size try using the anchor property.
|
|
|
|
|
I've noticed that when the visible property is set to false, the control's data is not available by code. Does this make sense? I've had to hide my controls that hold data behind other controls. Am I doing something wrong?
Thanks.
|
|
|
|
|
What data do you mean? Like the text in a textbox or items in a listbox? That data is available. The visibilty of the control shouldn't effect that type of information. Maybe you could give a more specific instance.
|
|
|
|