|
What i need, and ive seen it in a running app., so it can be done. Is that the app. checks the first logged on user info for first settings, or maybe its starts standard with no user loged in for the app. or a default user, because with first start up you can't access any buttons, except for a logon button in the app. And when you logon you can access the program except for the controls that are under an admin group. Then you have to logon with an admin user and password. The user info is than set in a label like username, in the program i've seen it's used for communication with other programs where he recognises your user and role and does the same restriction based settings, but i don't need that, just working with one app., so the user is actualy saved somewhere or in a way logged on. But when you open the start menu, you are in windows still logged on as the default user, so your user that falls under a group that is set in users and groups, is used for the app, but not for the windows logon. The app uses its own logon and uses the groups that u put in users and groups, but i'cant see any user in the users menu, just a default user used to logon windows, It also uses Active Directory. When i first had to set my password i just had to use the windows logon to set my password then it could be used in the app. So i'm not sure how this functions.
|
|
|
|
|
Hi all
every month i have to parse out a bill that comes to my company
so i decided to write a program to do it for me
right now i can parse it out ( by feild) and add it to a sorted list
so it comes in
username 1 , charge
username 2, charge
username 13, charge
username 1, charge
username 1, charge
username 4, charge
(no order)
and i parse it out to:
username1 , total bill
username2, total bill
The problem is that now they want it sorted by department ( give a mouse a cookie)
so im playing around with a sorted list and a structure
so it comes in
and the sorted list looks like this
key........value
username , structure (.username, .department ,.total)
it does all the math fine but im having trouble searching and displaying the structure after i get it into the sortedlist
any ideas
|
|
|
|
|
Hi,
in the SortedList the keys are the one you are sorting after, so in this case you sort by username and not by department. You can also access the structures rather quick (binary search algorithm) via the username:
MyStructure structure = (MyStructure)sortedList["username1"];
You shouldn't use the SortedList in this case. You could just create a normal Array of your structures
(MyStructure[]) and sort it:
MyStructure[] structures = CalcStructures();
Array.Sort(structures, new MyStructComparator);
public class MyStructComparator : IComparer {
public int Compare(object obj1, object obj2) {
return ((MyStructure)obj1).Department.CompareTo(((MyStructure)obj2).Department);
}
}
Now you could also easiliy add as much properties as you like and sort them accordingly.
|
|
|
|
|
Pardon the newbie quesiton but isnt that c+ code?
|
|
|
|
|
My structure and my sorted list
Dim ipassinfo As New SortedList<br />
Public Structure user<br />
'Declare data members<br />
Public username As String<br />
Public department As String<br />
Public domestictotal As Decimal<br />
End Structure
Breaks up the line
adds it to my structure
adds the user name and the structure to the sorted list
fields = MyLine.Split(ControlChars.Tab) 'Or Convert.ToChar(Keys.Tab)<br />
<br />
<br />
'check to see if entrie already exists if not create it<br />
If ipassinfo(fields(2)) Is Nothing Then<br />
'loading the structure<br />
userinfo.username = fields(2)<br />
userinfo.department = "???"<br />
userinfo.domestictotal = fields(9)<br />
'adding the structure to the sortedlist under key username<br />
ipassinfo.Add((fields(2)), userinfo)<br />
Else<br />
' adds charges to total if allready exists<br />
userinfo.domestictotal = userinfo.domestictotal + fields(9)<br />
End If
|
|
|
|
|
Hi,
sorry about the C# code. Sometimes I just forget in which forum I am
I assume your code runs inside a loop over all entries.
After that (such that upassinfo is completely filled) place the following code:
Dim userarray As user()
ReDim userarray(ipassinfo.Values.Count)
ipassinfo.Values.CopyTo(userarray, 0)
userarray.Sort(userarray, New MyStructComparator)
Dim u As user
For Each u In userarray
'do something in sorted order
Next
Moreover you'll need this class:
Public Class MyStructComparator
Implements IComparer
Public Overridable Function Compare(ByVal x As Object,
ByVal y As Object) As Integer Implements IComparer.Compare
Return CType(x, user).department.CompareTo(CType(y, user).department)
End Function
End Class
|
|
|
|
|
Hi,
I have the following questions:
How can I write data in an Excel sheet and what is the proper object to display data in from an Excel sheet in a Windows form?
How can I insert input data from a form in an existing Microsoft Word document and how can I display the result?
Thank you.
-- modified at 2:05 Monday 1st May, 2006
|
|
|
|
|
hi ,
please i have a problem with date & time
as you know SQL Server have just a datetime type when i want to recuperate date from database in a textbox i got both the date&time in the same textbox ,but i want to get just the date or just the time
i hope you nderstood me
please if you did ell me how to do because i have a real problem with
thank you very much
try to be good if you can't be the best
|
|
|
|
|
VB or VB.NET?
Show the code that you have problems with, or noone can help you with it.
---
b { font-weight: normal; }
|
|
|
|
|
Mohammed Amine wrote: as you know SQL Server have just a datetime type
Actually it has a DATETIME and a SMALLDATETIME
Mohammed Amine wrote: i want to recuperate date from database in a textbox i got both the date&time in the same textbox ,but i want to get just the date or just the time
You can use DateTime.ToString()[^] to format the DateTime object.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hi ,
please i added a picturebox to my application & it is behind all the controls of the form but i have labels on this picture & i wanna make this labels trensparent it was possible in vb.6 can you tell me how to do it in vb.net ??
thank you for your help
try to be good if you can't be the best
|
|
|
|
|
Set the BackColor property of Label to Transparent.
regards
Mubashir
|
|
|
|
|
thnx , but i don't think it will work because it is no transparent propriete in vb.net isn't it ??
may be i'm wrong i will seek for but i hoe to get an answear concerning vb.net i know this propriete exist in vb.6
thank you anyway for your help
try to be good if you can't be the best
|
|
|
|
|
Hi to all,
In IN WINDOW APPLICATION, I would like to know how can I print the page of the output window programically.
Thanks
Pankaj Garg
-- modified at 10:59 Sunday 30th April, 2006
|
|
|
|
|
|
Hi,
How I can copy any file to special directory >>
example:
file:- "red.avi" on the desktop.
directory:-" vedio" on the C.
How I can copy red.avi and put this copy in the C:\vedio
where become C:\vedio\red.avi
|
|
|
|
|
FileInfo class[^]. Look down the table, about the middle, on this page and you'll find a couple links to examples.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
tank you very very much >>
|
|
|
|
|
I am a complete newbie to programming and I need to work out how to use an on-screen keypad to enter values into a text-box. I'm not sure how to get the numbers to appear without erasing previously entered numbers. I know this is very basic but can anybody help?
|
|
|
|
|
Let's see the code your using. If your replacing everything in a TextBox when you hit a button, you're probably not assigning its Text property correctly.
I'd put this at an intermediate level task. On the surface, it looks really easy, but you have to have more than just a passing knowledge of how focus and selection works and how to track it properly.
If this input method was to be used in multiple places, it would be better written as it's own control.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
I have form1 as MDI parent and i displayed the form2 as MDI child of form1 then i want to open form3 as MDI child of form1 from form2.
Please give me the solution.
Thnaks in advance.
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
This is not a good idea. The parent form should open all of it's child forms. Child forms should not be opening sibling child forms.
It can be done, but makes for spaghetti code:
Dim myForm As New Form3
myForm.MdiParent = Me.MdiParent
myForm.Show()
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 11:06 Sunday 30th April, 2006
|
|
|
|
|
Well, thanks for this help n i got one more solution for that:
Dim myForm As New Form3
myForm.MdiParent = Me.ParentForm
myForm.Show()
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
Either way. They both point to the same parent.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i am continuing my friend 's system, how can i find where is the declaration of this variables ,
loginID = txtUser.Text
because when i move the mouse there,i can see
public dim login ID as string
pls help me
|
|
|
|