I'm working a lot with WPF, but have never arrived at the point to need this.
And currently I have no idea how to accomplish this. With subclassed controls it should be possible, but currently I have not the time to try it.
Thanks for the reply. I am working on a library application, for processing statistics. Their requirement is to move the form using the arrows (up or down), and the numeric values are in the "99 999 999.99" format. I think it will be a tough job if I want to do it at the WPF
Sorry but I am not the best person to advise on the XSharp side of things.
But I have used WPF. I am more of a C-Sharper looking in, still using old/fading memories of VO.
That being said, using WPF is quite a hurdle to jump as I think you recognise when you say "it will be a tough job." Tough jobs take time and there is no way round this.
FWIW and all the complexity of WPF (and learning to use it), it is a well engineered, comprehensive and powerful bit of software which takes care of almost everything automatically. Trying to get into it via Keyboard Events may not be the best way to start.
I still really don't fully understand what you're trying to do. You talk of a "library application to process statistics".
I can only guess that you are trying to present large amounts of numerical data in a meaningful and easy to understand way - Bar Charts, Pie Charts and so on. To do that you'd certainly need WPF and it would take some time.
I agree. I have gone from programming in Clipper 87 and Clipper 5 in MS DOS, with the arrival of Windows I went to Visual Objects and later Vulcan Net, who taught me to use Visual Studio. I welcomed the emergence of XSharp, which we will be able to program in .Net. I am fortunate that I do not have to migrate old applications from VO, because I used more 3rd products and it would be complicated. Already in Vulcan Net, I tried to write new applications with minimizing VO dialects. I've run a few Vulcan apps to XSharp applications without any problems, of course in WinForms. But I'm programming new applications in the WPF and Core dialects, because I also think it's my future. I make customized programs, small applications according to clients' requirements. I try to meet their requirements. That's why I want to program a form in which you can move with the arrows. A lot of numeric data is populated, so the input from the keyboard is preferred. Older clients have a little trouble using TAB and Shift + Tab while moving in a form.
I never programmed in C #, just recently I imported a few short examples that were written in cs. I managed to rewrite them to xs, only with this last I fail. I want you to emulate the tab keystrokes after the down arrow down or up the program.
Finally, I would like to congratulate myself on my English. I'm from the generation that learn Russian in the eastern block.
<TextBox Name="ttPagina" Height="25" Width="37" MaxLength="3" TextChanged="TextBox_ttPaginaChanged"/>
So I have a method which is called when something is typed in a box. Not sure if it works with cursor keys, but I can use + and - to browse pages on our Teletekst browser, and type 3 digit page numbers after which the page is opened without the need to press enter:
METHOD TextBox_ttPaginaChanged(sender AS OBJECT, e AS System.Windows.Controls.TextChangedEventArgs) AS VOID
which is like the EditChange from VO.
I start with this:
IF !SELF:lTxtBoxUpdated // This method just updated a message and hence directly runs again do NOT set lDoNotUpdateTxt to false to keep the above message in view
lDoNotUpdateTxt:=FALSE // Init: update status
lDoNotUpdateTxt:=TRUE // do NOT update status
SELF:lTxtBoxUpdated:=FALSE // and reset for future use
and then I can react on any key typed in.
Next thing you may want to test is:
PRIVATE METHOD ttBrowser_Navigating(sender AS OBJECT, e AS System.Windows.Navigation.NavigatingCancelEventArgs) AS VOID
//#s Set up in Webbrowser define in XAML and called when a hyperlink is clicked 12-12-2014
We use that in the webbrowser to catch hyperlinks and act upon it, like this:
<WebBrowser x:Name="ttBrowser" Navigating="ttBrowser_Navigating"
but I would say you could do that on any control.
I understand and think you have chosen the right path for your career development. It would have been the same path I would take myself if starting out now.
VO represented a brilliant bit of foresight on the part of its developers, who saw a way of removing the need for Application Developers to concern themselves with the underlying electronic technology.
Things move on. Now, and I am talking right up to date, 2019, we are in a position where we can change all aspects of what our application programs can do independently without having to re-write everything from the ground up.
We can produce programs which are effectively FUTURE PROOF.
In no area is this more important than the "Business Application Area" i.e. XSharp target.
Business requirements overall can change quickly. (At the drop of a hat!)
Re-writing thousands of lines of code, simply because this wasn't foreseen when the application was first structured, is out of the question.
Now the logic to do this has been made possible by Microsoft. It is possible because of the programmability of the re-imagined Roslyn compilation process and can be applied to any program using Roslyn-based compilation.
At this time, in the C# world, this tends to be explained and implemented by manual code modification (a lot of learning / time). My guess is that software tooling to simplify the whole process will emerge and XSharp apps will benefit.
You define the method to be called in the XAML code of the control and the called C# method is only a few lines is easy to convert to X#. Note that you can also add a C# project to your solution and call the C# methods as if they are written in X# - without the need to convert anything, should you encounter a more complicated but working C# method somewhere.
Thank you for your good pleasure. I have no problem to check which key was pressed, the problem was to emulate press Tab or Shift + Tab. I found one solution that fits my application. It was also in C#, but I managed to convert it to XSharp. Be sure to use your advice in the future.