textbox_tapped event not firing in metro app - c#

I am building a win 8 app which has a textbox control inside a hierarchy of elements like ScrollViewer->Stackpanel->Grid->Image & TextBox. The textBox contain a tapped event to navigate to a page. This textbox_tapped event is not at all firing. I am not getting any error or exceptions also. Can somebody tell me the solution for getting this? Thank you.

Maybe something to do with the fact that you are testing it on a normal PC with a mouse, so its not a tap, though I'm not sure about that. You might get a similar result by using the "GotFocus" event instead.

Related

C# Gecko Browser Drop Event Simulation

I want to simulate drop event in my code on an outside control.
I am using a Gecko browser which connects to outside web application, which code I don't have access to.
I was thinking about two solutions to this, the first would be to simulate drop event providing a filepath, however what I did below is not working:
GeckoNode dropbox = ContentFrame.GetContentDocument().GetElementsByClassName("filepicker dropzone dz-clickable").FirstOrDefault();
if (NodeType.Element == dropbox.NodeType)
{
DependencyObject fakeobject = Application.Current.Windows[0] as DependencyObject;
GeckoHtmlElement drop2 = dropbox as GeckoHtmlElement;
drop2.Focus();
DragDrop.DoDragDrop(fakeobject, path, DragDropEffects.Copy);
}
The element which I can drop files into, on mouse click opens the "open file dialog".
The second, probably harder solution would be to somehow capture the dialog box and paste my path into it.
Or maybe there is a way to make my code still running independently of dialog box that appears and use SendKeys or something like that?
Thank you in advance for your help! (Two days of googling didn't bring me any useful results..)
Edit:
As there were no answers, maybe anyone could answer a simpler question:
How to simulate the drop event just in WPF/WinForms? What are the steps and declarations prior to use DoDragDrop (or similar) interface? I am trying to drop a file on a droppable control (simulated in C# code) on an external Website.
Thank you!

Add/remove event subscriber in application bar item?

Why would I do that, anyway? Here it is: My application bar item respond to click like this:
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Click="Customization" x:Name="Custom"
It allows the user to go to settings page, but the user still has something to do before the app navigates. The actual event that will make the app navigates is triggered by a normal button. So, before, the user do that, I'd like to remove the event suscriber from the application bar item.
If I try this in the beginning of method "Customization":
Custom.Click -= new System.EventHandler(Customization);
I got NullReferenceException.
That's how I do for my "normal" items and it works. This is the first time I'm using a System.EventHandler, so there's probably something that I'm missing.
Later in the scenario, I'd like to be able to re-add this suscriber to the application bar item.
Any help appreciated, thank you.
You can't access AppBarButtons that way.
Try
((ApplicationBarIconButton)ApplicationBar.Buttons[0]).Click -= new System.EventHandler(Customization);

What Events does the Setting Charm fires?

Does a page is getting an event when the Setting Charm is closed?
Thanks
EitanB
There is no event when the pane is closed - depending on your particular implementation, you can either rely on CommandRequested - triggered when a specific item was selected, or on your independent handler that is in your Popup (that might show specific setting options).
Windows.UI.ApplicationSettings.SettingsPane.GetForCurrentView().CommandsRequested

WatiN choosing the correct event string to use with FireEventNoWait for an input textfield

I want to get the input value of an <input type="text"> element, on the fly (while it is being typed) and implement a search method with it as parameter.
I have this piece of code:
_window.Frame(WatiN.Core.Find.ById("a_frame"))
.TextField(WatiN.Core.Find.ById("an_element"))
.FireEventNoWait("event_string", other params);
What event would you think is the best suited for this? I have some thoughts on KeyPressed or KeyUp, but I'd like some other opinions for this matter? I have searched for TextChanged and some similar Event, but I haven't found anything.
Are we to assume the above code isn't working, or? If nothing else works you could always do a do loop right after the text box gets focus, do loop would contain these:
Sleep 100
Doevents
And of course after every 100 ms break and a Doevents, you can check to see if .value has changed, and if so, query your search. When the text box looses focus, you stop the loop.
You are using the webbrowser control, right? And you want to d this using the webbrowser control as opposed to JavaScript? Because, you can get keyup keydown events through the webbrowser controls eventing system, and that would be a better way to do it, but I'm not clear on the who what when where why of what your doing :)

Form Closing event

I have a smartdevice project targeting windows mobile 6.
In the top right corner is an X (provided by the controlbox). i have an event on the form_closing that i was hoping would fire when the cross is clicked. But it doesnt :-(
Does anyone know why this event is not firing ???
Thanks :-)
John
Set the MinimizeBox property of your form to false. It's a weird thing about WinMo forms, but the X in the corner is really a minimize button, so it doesn't actually close the form. Setting MinimizeBox to false will replace the X with an OK button, and you'll get the form closing event.
Read this: http://msdn.microsoft.com/en-us/library/system.windows.forms.form.closing.aspx
There are a number of possible reasons why theis could be happening, but I seriously doubt anyone will be able to guess why in this case, without you letting us see any of your code?

Categories

Resources