|
I created a new control derived from MaskedTextBox. The new control should react on a change of its Culture property, i.e. if the user changes the Culture something like a CultureChanged(object sender, someArgs e) event should be fired. I want to use this event to change some internal setting in the new control.
I have no clue how I can attach an event to the Culture property so it is fired, when the value of Culture changes. I tried to override the Culture property and to fire an eventhandler there, but unfortunately Culture can not be overriden (or at least I didn't figure out how).
Has anybody an idea how I could do it? I would be very glad for any hint in which direction to go.
Thanks
Dirk
|
|
|
|
|
Take a look at the new Modifier[^].
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Dear All,
I have an n-tier application that is devided into main three parts:
1. UI -> Windows From (dot Net Framework 2.0).
2. BL -> Web Services.
3. DB -> SQL Server 2005.
The Problem Is:
There are crystal reports files on the server and i need to display them
but the windows form crystal viewer - as i know - doesn't take a URL as a report path and for security issues i cann't put my crystal files along with the exe or along with the client machine...
soo please help.....
Ala'a Al Atrash
Special Systems Co.
Culture St. - Amman - Jordan
Software Developer
Work Tel:- +962 6 5664221 Ext. 140
Home Tel:- +962 6 4752702
Mobile Tel:- +962 7 96700423
|
|
|
|
|
Hello All!
I am working on this FileSystemWatcher class. I am successful in updating an SQL database with the changes/events that fires from the FileSystemWatcher. But, when I convert this into an windows service using the aid of this link:
http://msdn2.microsoft.com/en-us/library/zt39148a(VS.80).aspx[^]
I am not able to update the database. The functionality/sln works fine when it is running on Visual Studio.
Can anyone post a link where sql db is used in the windows service?
Thanks in adv!
Ananth
|
|
|
|
|
Sounds like the user that runs your service does not have permissions to access your database.
Goto "Settings->Control Panel->Administrative Tools->Services". Open the properties for your service, then look at the "Log On" tab-page. This will tell you the user that is running your service. Then make sure that that user has permissions to log into your database and to access the file-system folders that you are watching.
|
|
|
|
|
There are no restrictions on a service updating an SQL database. The problem is probably caused by you using a Trusted Connection in your connection string instead of supplying an actual username and password to login to the SQL Server. Any normal service, by default, uses the LocalSystem account, which isn't going to be trusted by a remote SQL Server.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have a custom control in a form and I want it to catch the key I press, so I implement the "KeyDown" event, its ok but the event does not fire when I press TAB, Up, Down... (the keys that is used internal to change the tab index of control inside the form).
How can I disable it and handle those special keys?
Thank you for your help!
|
|
|
|
|
Hello,
When you use te KeyDown event the member 'KeyData' is what you are looking for.
if(e.KeyData == Keys.Tab)
{
e.Handled = true;
}
All the best,
Martin
|
|
|
|
|
But it is not go to the KeyDown method at all when you press Tab, we can not check it.
|
|
|
|
|
Hi,
It may sound weird but if you want to trap the TAB key for a control
then you should check it in the KeyUp event of the next control(Next Control : control is getting focuse On pressing Tab)
|
|
|
|
|
Hi,
AFAIK you should override IsInputKey().
|
|
|
|
|
Hello Luc,
I also tried it, because I'm currious, but sadly it doesn't jump in the overriden method.
Tried it in the MainForm and in an UserControl.
protected override bool IsInputKey(Keys keyData)
{
return base.IsInputKey (keyData);
}
I read the msdn infos and know how it should work, but now I'm confused?
Any hints?
All the best and mercy,
Marin
-- modified at 11:45 Wednesday 28th February, 2007
Ok, just found out how to use it in an inherit TextBox for example:
protected override bool IsInputKey( System.Windows.Forms.Keys keyData )
{
switch ( keyData)
{
case Keys.Tab:
return true;
default:
return base.IsInputKey(keyData);
}
}
But it's not working on an UserControl or Form.
All the best,
Martin
|
|
|
|
|
Hi Martin,
Martin# wrote: But it's not working on an UserControl or Form.
What do you mean by this ? Is your IsInputKey() not called at all ? (for regular chars,
for TAB, arrows...) ? or is its return value simply ignored ?
And for which .NET version is this observation ?
I am using IsInputKey() on Panels only (both 1.1 and 2.0), no problem there.
|
|
|
|
|
Luc Pattyn wrote: s your IsInputKey() not called at all ? (for regular chars,
for TAB, arrows...) ?
Yes, in all points!
-- modified at 14:12 Wednesday February, 2007
I'm just rereading what I was answering before.
I think it was not clear.
What I meant, was that it is never called!
-- modified at 5:09 Thursday 1st March, 2007
I'm only using 1.1
|
|
|
|
|
I tried it too,
I override the IsInputKey method for the FORM, and the method was not called.
According to MSDN, it should be called.....
|
|
|
|
|
I have a weird problem. I have a VERY simple application that has been associated with a extension of .tix on my computer. Basically I want it when I open this .tix file, it sends the contents of the file thru the serial port. All the application has to do is send the data, and then close so there is no need for a form or anything else. What I have done is created a simple desktop application and in the Program.cs file I changed it to the following code. Just for testing I have hard coded in the contents of the .tix file into the variable TicketText. In Visual Studio when I run the application in debug mode I get a MessageBox that says "Ticket Printed-" and the application closes. The information is sent correctly thru the Serial Port as it should. When I load a .tix file then nothing is sent to the serial port. What is the difference?
<br />
static void Main(string[] args)<br />
{<br />
string TicketFileName = ""; <br />
try<br />
{<br />
TicketFileName = args[0].ToString();<br />
}<br />
catch { }<br />
<br />
SerialPort sp = new SerialPort();<br />
<br />
string TicketText = "Brad Presents BX3";<br />
<br />
sp.PortName = "COM4";<br />
sp.BaudRate = 1200;<br />
sp.Parity = Parity.None;<br />
sp.DataBits = 8;<br />
<br />
sp.Open();<br />
sp.WriteLine(TicketText);<br />
sp.Close();<br />
<br />
MessageBox.Show("Ticket Printed-" + TicketFileName.ToString());<br />
<br />
Application.Exit();<br />
}<br />
|
|
|
|
|
Brad Wick wrote: When I load a .tix file then nothing is sent to the serial port. What is the difference?
Hard or even impossible to say without seeing the code that loads the file.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
it is in general a bad idea to ignore exceptions, which is what you do when specifying
an empty catch block. I suggest you put all your code in one try block, and
show the full exception.ToString() text in a messagebox when things go wrong (i.e.
inside the one and only catch block).
That will probably lead you straight to the heart of your problem.
|
|
|
|
|
My best guess at this point is that the call to Application.Exit() is causing a problem in release mode. If the application is exiting in any case, this call is unnecessary.
Phil
|
|
|
|
|
Using DirectX.Capture I lately found out that there is a problem in Lip movement and voice synchronization, i.e. when I apply Video Compression and without applying audio compression, say for example Microsoft Video 1, I found out that the voice and the lip movement does not match, sometime the voice/sound came out after the lip movement or vice-versa. What is the problem with these and how do I solve this problem. I will be very happy to get answer for this query.
Thanks in advance.
Suan Ngaihte.
|
|
|
|
|
1.I am wondering what is the need for attribute
if I have mechanisem calles interface to show behavior of classes?
2 . I saw some application that adding option in EXCEL FILE menu
how can I do this? (like after SAVE to add another option)
thanks
|
|
|
|
|
groundzero111 wrote: 1.I am wondering what is the need for attribute
if I have mechanisem calles interface to show behavior of classes?
Attributes are used for associating information with code elements. You can add attributes to most any code element, like types, methods, properties, classes.
Interfaces are used for defining a set of properties and methods. An interface is implemented by inheriting it, so it can only be done by classes or structs. An interface is similar to an abstract base class.
---
single minded; short sighted; long gone;
|
|
|
|
|
You are right about general use of attributes vs interfaces.
But then you have interfaces like INamingContainer[^]. It could as well be attribute. I wonder what's the reason why INamingContainer isn't attribute but interface. Well, maybe, maybe it's because interface express contract (in this case class implementing INamingContainer promises it will be able to provide unique names for its children. ) while attribute just adds metadata.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
An interface works as a base class in the respect that you can create a reference to an interface, and use that reference for any class that inherits the interface. That enables you to use the members in the interface without needing to know the actual class of the object.
---
single minded; short sighted; long gone;
|
|
|
|
|
You missed the point, INamingContainer doesn't add ANYTHING to class implementing it, it's just marker. You do not use things as INamingContainer , you just ask them if they are INamingContainer . So from "how it works" point of view it could as well be attribute.
Guffa wrote: An interface works as a base class in the respect that you can create a reference to an interface, and use that reference for any class that inherits the interface.
I know how interface works, and I know how base class works.
Guffa wrote: class that inherits the interface.
You do not inherit interface, you implement interface. Inheritance express that something is specialization of base class, while implementing interface express that two possibly unrelated things have same capabilities (described in interface). That's little semantic difference.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|