|
Checked Items is a collection, as you can see. You need to use foreach to step over this collection, and get the names of all the checked items.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You mean you want to see Check
foreach (string checkedval in this.checkedListBox1.CheckedItems)
{
}
|
|
|
|
|
Hi there.
I'm trying to write a c# code that will automaticaly initiate a user login, if the user is logged off for a given period of time.
I've tried using the ADVAPI32.DLL's function LogonUser, but apparently that is used for impresonation (am i wrong?).
So, how is that done?
In addition, i failed to find a way to check if a specific user is logged on or not.
Any idea?
Thanks,
SummerBulb
|
|
|
|
|
Although I believe you can write C# code in a service that will run when a user is logged off, I doubt you can log on through such code.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
How are you planning to run your code while there is no user logged in? Do you not think this defeats the purpose of having a login?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
The code will run as a service.
I've already managed to run a c# application as a service.
That's the easy part.
Although, is should be takan into consideration that in order to run a c# app in th logon window, is has to run under SYSTEM.
That might make things more complicated.
|
|
|
|
|
|
Hi,
i have a form with 3 combobox which is bind to datatable
i use combobox.datasoure to bind to datatable
And on 1st combobox selectedvalue i need to send the cbo text to database and get another set of datas and populate 2nd cbo with datatable
So for this, if i use selectedindexchanged event it is fired so many times...
this event is fired when i bind the combobox to datatable using
combobox.datasource = datatable;
so after googling i use selection change committed event
this event is fired after user selection and before combobox dropdown closed....
and this event doesnt fire on datatable bind.
But my problem now is, in selectionChangeCommitted event, the combobox selectedvalue is currently selected value and the combobox.text is previously selected text , so i cudnt pass the combobox selected text to database to retreive the datatable...
cud anyone plz help me to resolve this issue?
thank u
|
|
|
|
|
Are they all bound to the same table, or to copies of it ? If they bind to the same table, they will keep in synch with each other.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
No they are not bind to the same datatable...
depending on 1st combobox's text, i need to fetch different set of data from database and populate 2nd combobox
|
|
|
|
|
I'd set up the datasource, THEN write the code to bind to the event that you want to bind to.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
thanks for ur reply.
I know how to bind the datatable to combobox datasource.
But the thing is, on selectionChangeCommitted event, the selectedvalue gives currently selected value, bu t the combobox text is previously selected value...
i want to get the currently selected text...
|
|
|
|
|
You said that using the selectedindexchanged event worked, but it fired a lot as it binds. I am saying, use that, and connect it AFTER binding.
Also, go into the debugger, and check if SelectedText or just Text is the right property to get the new value.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Can u plz be more acurate in "connect it after binding"...
i really cudnt get wat u mean.....
i have written the below statement in form load...and this is the first combobox... depending on this value i need to get datatable for 2nd combobox.. But as soon as i bind it fires indexchanged event.
combobox1.DataSource = dtSubclass1;
after this statement, selectedindexchanged event is fired.... but i dont want it to be fired..
|
|
|
|
|
vidhyaravichandar wrote: after this statement, selectedindexchanged event is fired.... but i dont want it to be fired..
Well, it's really simple. Don't hook up the event until after you set the data source. As I said.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hey.
I am having a application that uses a IE webbrowser control.
I know how to set a proxy overall for IE, but is there some way I can use a different proxy from each application with the webbrowser, that I have open ?
Or is there are smarter webbrowser control that can handle more proxies than just one?
|
|
|
|
|
Have the strangest problem, the NotifyIcon component will not "popup" its notifications under Windows 7. I even went into notification settings and explicitly told windows to always show all the icons and notifications, still nothing.
To make sure I wasn't going insane I copied the program to a Windows XP box and the notification icon worked as expected.
No to be defeated, I loaded up the registry on the windows 7 box, found the notification key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\EnableBalloonTips" changed the value from 0 to 1 and still nothing.
Has anyone else seen this problem.
Matthew Hazlett
Fighting the good fight for web usability.
|
|
|
|
|
The NotifyIcon doesnt show when Icon is not specified to it.
Assign an ICON to it and see if it works now or not.
|
|
|
|
|
it works icon and all in windows xp
Matthew Hazlett
Fighting the good fight for web usability.
|
|
|
|
|
Think maybe its a bug. All the notify stuff in win 7 is on yet it wont work. Works like a champ in xp.
Matthew Hazlett
Fighting the good fight for web usability.
|
|
|
|
|
i have get the names of headers of excel file and i have to list them in a specific column of a grid control.any idea hw can i do that?
|
|
|
|
|
Now, I realise that English may not be your first language, and that's fine. However, if you can't understand English enough to understand the answers you've been given, what's the point of asking the same question again, in English. If you understand English, then you're probably incapable of the task at hand, you must be no good at programming. Either way, don't ask the same question over and over, the answer will not change.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
There is a LocalSystem Service (Job.exe) which performs a certain absolutly required task (for example: file system watching), this service is run for all users (at least when they logon).
There is another LocalSystem Service (Serv.exe) which uses CreateProcessAsUser(...) to launch a process as a different (admin) user.
There are 2 accounts, USER (which is the one logged-on) and ADMIN.
So this is the scenario ...
User logs in to USER account (non-admin) and both LocalSystem Services (Job.exe & Serv.exe) start and work without any problems... Then at a certain point Serv.exe calls CreateProcessAsUser() using the ADMIN account in order to launch an administrative task (note that USER is currently logged in).
So far everything is fine - but now a problem happens - the process run by CreateProcessAsUser(...) under the ADMIN is not subject to the LocalSystem service JOB.exe - for example if JOB.exe monitors file-system changes and logs them if I launch a task with CreateProcessAsUser(...) under ADMIN that changes files I would assume JOB.exe would log these - but it does NOT ...
So it looks like JOB.exe is NOT running in the context of the ADMIN account when launched using CreateProcessAsUser(...), this is a big deal for me - I need to ensure JOB.exe LocalSystem service is absolutly always running - even when CreateProcessAsUser(...) is used...
Is there anything I can do to solve this problem? any help would be much appreciated.
Can I load the environment? profile? something to kick-in JOB.exe so that it actually works?
Thanks,
|
|
|
|
|
JOB.exe is legacy software that monitors registry and file system changes - sadly I don't have the source code available to show exactly how it works but ... it works fine for the logged-in user.
Do I maybe have to do something special to my CreateProcessAsUser() to load the environment? Profile? etc... I also noticed that accessing HKEY_CURRENT_USER doesn't seem to work ...
|
|
|
|
|
Hi,
I have a FlowLayoutPanel, and I implemented it's SizeChanged Event,
the strange thing is when I change the size of the FlowLayoutPanel, the event is called two times, I don't know why.
for example:
FlowLayouPanel p = new FlowLayouPanel();
p.Size = new Size(10,10);
when debbuging this line the event SizeChanged called two times.
any ideas why ?
C.R.E.A.M
|
|
|
|