|
I have a solution to my post, and here it is.
<br />
public class TimePicker : ComboBox<br />
{<br />
bool m_fIsDropDown = false;<br />
string m_strTime = string.Empty;<br />
int m_nSelectedIndex = -1;<br />
<br />
<br />
public TimePicker() : base()<br />
{<br />
}<br />
<br />
private void LoadTimes()<br />
{<br />
if (this.Items.Count < 1)<br />
{<br />
DateTime t = new DateTime(2005, 10, 11, 0, 0, 0, 0);<br />
while (t < new DateTime(2005, 10, 12))<br />
{<br />
this.Items.Add(t.ToShortTimeString());<br />
t = t.AddMinutes(30);<br />
}<br />
}<br />
}<br />
<br />
protected override void OnCreateControl()<br />
{<br />
base.OnCreateControl();<br />
<br />
LoadTimes();<br />
}<br />
<br />
protected override void OnDropDown(EventArgs e)<br />
{<br />
base.OnDropDown(e);<br />
<br />
m_strTime = this.Text;<br />
DateTime dtmValue = DateTime.Now;<br />
try <br />
{<br />
dtmValue = Convert.ToDateTime(m_strTime);<br />
}<br />
catch <br />
{<br />
return;<br />
}<br />
<br />
for (int i = 0; i < this.Items.Count; i++)<br />
{<br />
DateTime dtmItem = Convert.ToDateTime(this.Items[i].ToString());<br />
if (dtmValue >= dtmItem && dtmValue < dtmItem.AddMinutes(30))<br />
{<br />
this.SelectedIndex = i;<br />
m_nSelectedIndex = i;<br />
break;<br />
}<br />
}<br />
<br />
m_fIsDropDown = true;<br />
}<br />
<br />
protected override void OnMouseDown(MouseEventArgs e)<br />
{<br />
if (m_fIsDropDown == true)<br />
{<br />
this.SelectedIndex = m_nSelectedIndex;<br />
this.Text = m_strTime;<br />
}<br />
else<br />
{<br />
base.OnMouseDown(e);<br />
}<br />
}<br />
<br />
protected override void OnMouseUp(MouseEventArgs e)<br />
{<br />
if (m_fIsDropDown == true)<br />
{<br />
this.SelectedIndex = m_nSelectedIndex;<br />
this.Text = m_strTime;<br />
m_fIsDropDown = false;<br />
}<br />
else<br />
{<br />
base.OnMouseUp(e);<br />
} <br />
}<br />
} <br />
--IAN
|
|
|
|
|
is there a way to hide a process from System.Diagnostics.GetProcesses()? so it would not list it? or if its listed not be able to access its information?
also is there a way to tell which process is attempting to hook to yours? or is attempting to access yours?
so if i say:
Within Process "B"
{
System.Diagnostics.Process tProcess = System.Diagnostics.GetProcessByName("B");
event(System.Diagnostics.Process pAnotherProcess)// when another process is accessing yours
{
if(pAnotherProcess.ProcessName == "B")
Message("your accessing your own process");
}
}
i know this might be C++ section but just want to find out what i need to do to detect this?
or away to catch any calles to get process information.
CALLER-->GetProcess()-->RedirectToMyFunction-->Pass/Reject Request-->CALLER
-- modified at 11:13 Thursday 13th October, 2005
|
|
|
|
|
mishen` wrote: is there a way to hide a process from System.Diagnostics.GetProcesses()? so it would not list it?
No.
mishen` wrote: or if its listed not be able to access its information?
Process Security and Access Rights[^]. You'll have to P/Invoke a bunch of functions and structures to alter your process' ACL. There is nothing in the .NET BCL (1.0 and 1.1) that supports this.
mishen` wrote: also is there a way to tell which process is attempting to hook to yours?
No.
mishen` wrote: or is attempting to access yours?
No.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for being streight forward.
so most questions answered thanks. most glad that the process cant tell if your hooking to it.
thanks for he link.:->
|
|
|
|
|
Hi all,
i have a rich textbox and i want that the richtextbox
should be of A4 size i.e. it should accommodate contents
that of A4 size
the user should not be able to enter text if the contents
have reached the A4 limits
Please if anyone of you could help me
Thanks
Pramod
|
|
|
|
|
Hi!
I want my application to close if the user is not performing any keyboard or mouse activity and no process (copying file, query database etc.) is running for 5 minutes.
Can somebody how can I do this?
Thank You
|
|
|
|
|
|
I think it works for Keyboard and Mouse activities only but what about the running processes in my application i.e. read/write files or any non-idle process.
|
|
|
|
|
I want my application to trigger on external application start/close events but haven't been able to figure out how to do this.
For example. I would like my application to execute a certain task every time Internet Explorer is executed on the system.
I would greatly appreciate if someone had a solution to this!
Thanks!
// T
|
|
|
|
|
Well, one way you could do this (which isn't the best way I don't imagine, but I can't think of any other way at the moment) is to create a task watcher process that watches the task list and kicks off event "alerts" that you set when certain tasks are created/exited.
|
|
|
|
|
Yes, this is how I do it now..
I don't feel that this is the correct way of doing it though. I would imagine that you could hook on IE or trap a windows message to do this instead. I've tried searching for it on the net and haven't found anything
Hopesfully someone will have a solution
|
|
|
|
|
Problem!
I want to show some icons against menu items just like when we open Msword in its File menu there is different icon to the left most of each menu item . How to achieve this any help or idea.
Thanks In Advance
|
|
|
|
|
Visual Studio .NET 2005 (beta) provides MenuStrip control for this.
You need to handle the DrawItem event of the menu and set ownerdraw property to true (sorry I don't know the details. google for owner drawn menu with bitmap)
If you don't come up with the solution then google for VolveNet Menu Extender
|
|
|
|
|
Hello!
I am sorry if I am unable to state my problem clearly.
I am using an SQL Server 2000 database for my .NET Windows application(VB/C#).
My main MDI form has a large number of menus and options.
Do I use a table in the database for maintaining the users and their encrypted password and other details?
i.e User ID, Full Name, Password, Working Shift, Email Address etc.
OR
I must use SQL Server logins and roles?
If I use the first approach my triggers and stored procedures will not be able to utilize the User_Name() SQL Server function for logging the User transactions.
If I use the second approach, then, where do I store the detailed information about the user (i.e infomation about the user as in Windows Active Directory for a domain)
In most of the forms in my application each form is related to a single table of the database. And each of those forms performs Update, Insert, Delete operations on the table.
How do I enable/disable the Insert, Update, Delete buttons on my form accoring to the user permissions on that table?
Does SQL Server's Application Role have something to do with my problem?
And
How do I use the Application Role best.
I hope you understand my problem.
Anticipating a quick reply.
Thank you.
-- modified at 8:23 Thursday 13th October, 2005
|
|
|
|
|
You can do whatever suits your application best, but it's typical in large application settings with lots of users to have all access to the database take place through a small number (or one) login. Doing so has certain administrative benefits as well as performance benefits to the database server (wrt connection pooling, and cacheing commands).
If you're interested in doing declarative security, I would recommend checking out the IPrincipal interface and the classes that inherit from it. If you're writing a WinForms application, you may be able to take advantage of the WindowsPrincipal to leverage your AD security without making a lot of concessions. If that's not an option, you can make your own Principal, and roll your own authentication scheme as well. Either way, the Principal is a built-in authorization structure in .Net.
Best of luck.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hello,
How can I create a standalone .EXE file for my Windows Application, and the installation files for this application?
Thank you.
|
|
|
|
|
Not easily. The only langauge in vs.net that will produce native code directly is unmanaged(normal) c++. There are a few 3rd party tools that will compile the IL produced by the other .net langauges into an executable but they're all afaik expensive.
|
|
|
|
|
It is theoretically possible but what possible application would there be for doing such a thing? Not only would your application have to be "compiled" again but all subsequent assemblies have to be sucked in. You'd either end up with a very large executible or a complete duplication of the .Net Framework in a C runtime format.
You could ask the same thing about VB 6 to C and note no one does this. The possible advantages of changing runtime formats is way outweighed by the complexity of doing so.
|
|
|
|
|
can anyone tell about implementing mobile and intelligent agents in C#
|
|
|
|
|
Hi
I'm trying to work out how to nest datagrids. The parent child way that is supported by default is a little bit limited for my needs.
Here is an image of what i'm trying to do, I quickly photoshopped this together so theres no drill down buttons and lines showing the hierarchy.
Example
I also need to add things like combo boxes to certain columns (which I think I can do) I'm fairly new to windows forms, so I don't know by way around very well. I can find tons of stuff for ASP.NET but thats not helpful for my windows app. i'm trying to do this in C# using .NET 1.1
The data that goes into this datagrid comes from a join between two tables. Its a shame you can't write windows forms in HTML and CSS and it generates a windows interface from that
|
|
|
|
|
Hi Everyone,
Does anyone know if there exists Assemblies in .Net 1.1 with which I can do load balancing on a server app that accepts TCP connections?
Thanks and Cheers!
Phi?
|
|
|
|
|
As far as I know, load balancing is not done at the software application level. If NICs are load balanced they should automatically balance the traffice between the merged NICs. When you send traffic using .NET the load balancing should be auto handled.
|
|
|
|
|
Raheem is correct. Applications are not expected, nor recommended, to do their own load balancing. This is best left up to the server/network level. Your application must be written with load balancing in mind, though.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
When the treeView control's nodes are right-clicked,
the selectedNode of the treeView won't be changed unless
it is a left-click mouse event.
My problem is that I associated context menu to the tree
nodes, so user just right click the node to use the context
menu, however the selectedNode isn't the node that the context menu
is launched.
So how can I set the selectedNode to the node that is right-clicked ?
Thanks
|
|
|
|
|
Hi!
You could catch the MouseUp event and then use TreeView.GetNodeAt() to get the node the mouse is over currently.
Regards,
mav
|
|
|
|