|
Oh I know start the timers slightly offset on each record. Duck dodge weave rock hide under!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Oh I know start the timers slightly offset on each record. Duck dodge
weave rock hide under
Or just use one timer and update ALL records. I prefer your solution though.
|
|
|
|
|
hiii..
can any one tell me how to make batabse connectivty wid controls lik datagrid....
|
|
|
|
|
|
Hi All
i am converting an Excell spreadsheet into an application. So i am doing automatic calculations like Excell do , for some of the cells(textbox) should allow a user to enter the minus sign "-" , and this automatically minus value entered. So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ?
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Vuyiswa Maseko wrote: So my issue here is if th the users enters that character it breaks my app's
calculations. Does anyone have any idea how to bypass this ?
Without knowing how your application works, no. I don't know what code you've actually written, so how can I tell you what's wrong with it. I will say one thing though - if you can cope with positive numbers, you should be able to cope with negative ones. After all, taking away is merely adding a negative number.
|
|
|
|
|
hi Pete
Thanks for your reply. i am just looking at ideas without any coding examples. What i need is a logic to bypass this.
lets take a Cell in an Excel spreadsheet,you normally can enter numeric values and by default anything that has no sign "-" is a "+" so now when it comes to negative in Excel it will subtract the value in the cell from somewhere. So in .e.g asp.net or silverlight , if you want to mimic that Excel behavior how can do that , because immediately when that value is entered it changes the data in the textbox not to fall under "int" or "decima" because there is a special character.
You know what ?
i just Figured out.
i will keep the value as is and when it is being calculated against another Field , i will sum what needs to be summed and subtract on any field that has that sign
Sometimes when you explain the problem to someone you might find the solutiion
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Vuyiswa Maseko wrote: Sometimes when you explain the problem to someone you might find the
solutiion
Often the way my friend, and a 5 for such enlightenment.
|
|
|
|
|
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
|
Thanks nice
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
How to Comments on image at dynamically write sometext
on image in Silverlight.
|
|
|
|
|
If you just want to display dynamic text over the top of an image that is displayed in the UI, you simply need to place a TextBlock on top of the image and set the Text as appropriate.
|
|
|
|
|
<Grid>
<Image source=""/>
<TextBox Text="Enter comments here.." VerticalAlignment="Center"/>
</Grid>
The above code will put a TextBox in the center of the image where you can enter your comments. Further if you want to have an image with commented text that also you can create a dynamic Bitmap image.
Cheers!
Vinod
http://www.exploresilverlight.com
Cheers!
Vinod
|
|
|
|
|
How To create Image Annotation in Silverlight,Please
Help me.
|
|
|
|
|
Can someone atleast help me to find the mouse pointer location over the webbrowser control in WPF.
The only constraint is that you cannot create an event of the webbrowser control.
And just for the records,
Point p = Mouse.GetPosition(webBrowser1);
is not working !
|
|
|
|
|
You can get the Mouse Pointer as bellow:
Point p = this.PointFromScreen(Mouse.GetPosition(this));
txtX.Text = p.X.ToString();
txtY.Text = p.Y.ToString();
|
|
|
|
|
It is convenient to have an "Accept Button" (in WPF: IsDefault="True" ) on a Form.
In the Windows Forms world, I used to read the data from the UI to the object(s) in the corresponding Click event of the button.
But with WPF, data binding ought to be used. In the constructor of the Window, I set this.DataContext = test;
And here comes the problem: the user entered some text in TextBox2 , and hits the Enter key. Now, the command bound to the OK button gets executed, the data are saved.
But it is not the correct data! Why? TextBox2 has not yet lost focus, and consequently the ViewModel has not yet been updated.
[Edit]In Windows Forms, several controls have a Validating event. That event gets fired before the Click event event of the button, though the focus remains on that element.[/Edit]
How do you overcome such a problem?
modified 5-Jul-12 6:01am.
|
|
|
|
|
You should set the TextBox's UpdateSourceTrigger property to PropertyChanged and then it will automatically update the ViewModel whenever any changes are done to the text. Something like this :-
Text="{Binding Path=yourTextProperty, UpdateSourceTrigger=PropertyChanged}"
By default this property is set to LostFocus, which only updates the property when the user moves focus to another control.
Hope this helps.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thanks for the idea. But it is not only one text box. The user can hit the Enter key anywhere. And on every form with an accept button. This means that a general solution is required.
|
|
|
|
|
You can use UpdateSourceTrigger=”OnPropertyChanged” as a workaround to help you fix this in some scenarios.
Otherwise, its a WPF bug.
Check this post[^] out as well.
|
|
|
|
|
That link is very interesting. I have checked with a Windows Forms application (also .Net 4, Visual Studio 2010): the Leave event (corresponding to LostFocus) does not happen when the user hits the Enter key. That means, this behavior is consistent between Windows Forms and WPF. Only due to DataBinding, a problem arises.
[Edit]Test with C# 2005 Express, .Net 2: same behavior[/Edit]
modified 5-Jul-12 5:45am.
|
|
|
|
|
A while back, I created an Attached Behavior (I'm well known for my love of them), which I attach to the default button. This behaviour hooks into the click event and calls the following (this is from memory, so I apologise in advance if it's not 100% correct)
private void UpdateFocussed()
{
FrameworkElement el = Keyboard.FocusedElement as FrameworkElement;
if (el != null)
{
BindingExpression expression = null;
if (el is TextBox)
{
expression = el.GetBindingExpression(TextBox.TextProperty);
if (expression != null)
{
expression.UpdateSource();
}
}
}
}
|
|
|
|
|
That is a nice workaround.
|
|
|
|
|
You are too clever, sir !+5
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|