|
Ohhhhh, Kataric! When he said "KATARIC" I thought it was an acronym with which I'm unfamiliar.
Like, maybe, "Keep All The Access Rights In Check" or something.
|
|
|
|
|
Well, I just spent another five hours reworking my MouseTrap class.
It's way better than what I did yesterday. I'll probably write an article on it, but if you'd like be beta testers let me know.
|
|
|
|
|
I got it working guys. The MouseDown worked it seems.
This ended up being my solution.
//Init Function
this.button[i].MouseDown += new MouseEventHandler(Quest202_MouseDown);
//Handler Functions
private void Quest202_MouseDown(object sender, MouseEventArgs e)
{
switch(e.Button)
{
case MouseButtons.Left:
OnLButtonDown(sender);
break;
case MouseButtons.Right:
OnRButtonDown(sender);
break;
}
base.OnMouseDown(e);
}
private void OnLButtonDown(object sender)
{
Button temp = sender as Button;
if (temp != null)
temp.BackColor = Color.Red;
return;
}
private void OnRButtonDown(object sender)
{
Button temp = sender as Button;
if (temp != null)
temp.BackColor = Color.Black;
return;
}
Thank you for all your help. I really appreciate it.
|
|
|
|
|
|
Users? I'm writing this as an exercise for myself to learn c# becasue I don't know jack about it honestly.
Perhaps if what i'm doing transforms into something that might appeal to other people, I'll rewrite it to use more stable (if what i wrote is unstable, still don't know that) classes and whatnot.
Again, thanks for all your help guys. I'm sure I'll have more questions as I go along.
|
|
|
|
|
Well you're learning Jack now.
|
|
|
|
|
He's a great guy isn't he?
|
|
|
|
|
Hello,
I am developing a site with a ASP 2.0 Login control. The validation message works fine if the user's password is not correct.
When the password is the wrong case it does not login in the user, which is fine, but it does not fire the validation message either, which is a problem.
Can anyone point me in the right direction on getting the validation to work on incorrect case?
Thanks.
|
|
|
|
|
Translate both the original password and input password (attempt) to one case before comparing. (Most people don't want the incorrect case to be acceptable.)
|
|
|
|
|
Mike, correct. I don't want the incorrect password case to work.
If the user does not put in the correct password a validation message displays. I want this same message to display when a user uses the wrong case. Right now it just does a post back with no error message, it should be giving me the incorrect password message.
Any ideas what could be causing this?
|
|
|
|
|
The only thing that comes immediately to mind is to look for configuration properties related to case.
|
|
|
|
|
How do I create a windowless daemon in VS2005? Thx
|
|
|
|
|
A windows service can be considered a windowless daemon.
To create one, go to file>new>project and in your language of choice, choose Windows projects and Windows Service.
From there it's pretty self-explanitory.
HTH,
~dnc
|
|
|
|
|
Just as a community note: a windows service is not available w/ VS standard edition -- you must go higher.
Thx
|
|
|
|
|
LOL... sorry, I forget about that often... You could get around that by writing a console app and then using something like FireDaemon (I think that is the name?) that allows you to run an application as a service in Windows.
~dnc
|
|
|
|
|
public static Bitmap FromResource( IntPtr hinstance, string bitmapName ) I see that many others have had trouble getting Bitmap.FromResource() to work for them, and I've found conflicting or wrong information as to how to acquire the handle. Some examples call out to unmanaged functions. I'd like to avoid that if possible.
I have a VS2005 assembly DLL to which I've added many bitmaps as embedded resources (via Project.Properties...Add Files...). I assume that much is OK. Is there an entirely "managed" way to get the handle of the assembly to pass to the hinstance argument of FromResource()? If not, what is the recommended process?
|
|
|
|
|
For instance...
using System.Diagnostics;
myBitmap = Bitmap.FromResource( Process.GetCurrentProcess( ).Handle, @"MyBitmapResourceName" ); This call fails, reporting that the "Parameter is not valid."
|
|
|
|
|
This approach appears [?] to get a legitimate handle. The value is usually just over 1,000 -- 1,008, 1,032, etc. I've checked MyResourceName over and over again for case. I've tried all uppercase (which doesn't match the resource name), and I've tried odd syntax that I've seen in other examples (which resort to native C++ to get a handle) such as prefixing MyResourceName with "#" or including the file extension (which in my experience with resource files should be an error)... but still, all I get is a "Parameter is not valid" error:
IntPtr hInstance = Process.GetCurrentProcess().Handle;
if ( (IntPtr)0 != hInstance )
myBitmap = Bitmap.FromResource( hInstance, "MyResourceName" );
Process.GetCurrentProcess().Handle is as close as I've come to succeding, in that the value is possibly a legitimate handle/IntPtr value. Does anybody know how to do this?
|
|
|
|
|
hi
i have some tab controls and in tab_2_enter event, i want to set focus on specifid toolStripTextBox and selectAll method, but in runTime, when i enter to tab_2, toolStripTextBox does not selected, how to solve my problem ?
thanks
|
|
|
|
|
you can use this code:
toolStripTextBox1.Focus();
toolStripTextBox1.SelectAll();
Good Luck.
Alireza Loghmani
|
|
|
|
|
Hi All,
I am quite new to C# programming and have been reading lots of documents and books trying to get a handle on how to work with it. I am using Visual Studio 2005. I am wondering what the best way is to make an application that has one main "page" and different "sub pages" within it. I guess the best way to describe it would be to say I would like it to function like a tab control but without the tabs. The user would click on certain buttons/icons and a different "sub page" would show up on the application window. Kind of like if you have ever used Outlook or Outlook Express. There are links on the left hand side, such as Inbox, or Calendar, and when you click on these links, the "sub page" on the right changes to display whatever it is you've selected (exactly what would happen if it was a tab control and the user clicked on the appropriate tab, but without the tabs and without the tab pages).
I would like to design the entire interface in the Form Designer, and in last sample projects that I have done I have used the tab control (Then I could click on individual tabs and design that page accordingly .. I don't want to have to create buttons and everything programatically). I'm looking for a way to be able to do this without the tab control. (ie, create multiple "sub pages" and make them visible or not in code depending on which button/icon has been clicked). I have searched and searched but I think my problem is I do not know what this is called so that is why I am getting no where. Any help pointing me in the correct direction would be appreciated!
TIA
-- modified at 15:52 Tuesday 15th May, 2007
|
|
|
|
|
Maybe you want to take a look at some 3rd party UI library. We do use DotNetBar [^].
Usually these libraries provide much richer functionality than just pure Windows Forms.
|
|
|
|
|
Hi,
Thank you for the reply. The problem is that I am just learning C# and am writing code for various sample projects just getting a feel for it, so I do not really want to spend the $200 on a 3rd party library just because I'm not really building anything that is enterprise. I was just looking for a way to do this using forms designers with maybe group boxes or panels or some other element that I just have not come across yet.
Thanks!
|
|
|
|
|
You can build your page class from any Control descendant; utilize any list<t> or Collection you want to manage your pages; anchor each page to a page region; and build a navigation system to negotiate the page population. You can do a simple job of it to see what you're getting into. Professional results and deep functionality will not be trivial.
|
|
|
|
|
Not to seem like a total 'tard and be all offensive, but I did say straight up that I am new to C# programming.. I didn't undersand a word of what you said. heh, the guy from Germany spoke better English...
|
|
|
|