How can I close CharmBar programmatically in WinRT? - windows-8

I need to closing charmBar programmatically, how can I do it?

Try focusing on another control. For example, call
this.Focus();

Related

Closing an XAML form

I am creating a windows 8 store application using vs2012.
I am tying to switch to another xaml form by click of a button but cannot do it.
I want the code to close or hide the current form and to switch over to new form .
Regards
If you are looking to wholesale replace the content then you can use the Frame.Navigate() method.
Frame rootFrame = Window.Current.Content as Frame;
rootFrame.Navigate(typeof(YourPageClass));
or simply
this.Frame.Navigate(typeof(YourPageClass));
remember that not every elemet has property hide or something like that. If you want to hide a grid with form or do a simillar thing you need to know the property that is responsible for visibility (in most cases it is Visibility and it is a bool).
The second thing is that you can be a newbie but if you want help make some effort and give us what you want
The third thing. If you want to change a page after click use Marc`s solution

More text boxes in one inputbox?

I was wondering if there's a way to use more text boxes in a single inputbox?
So for example, I call an inputbox when a button is pressed and I want it to say something like this:
-Name: (textbox)
-Adress: (textbox)
Ok
Cancel
Where both strings can be read. Is it possible?
Thanks in advance.
No, this is not possible.
You can create a custom form for this task. To allow a non-blocking use, you could use a callback delegate or an event that is raised whenever the user closes the form.
As Nico said, not possible without creating a custom form (easy enough to do). Or you could just call input box twice.

Adding programmatically a control on top of others

I'm looking for adding a control on top of others controls during runtime.
I read that the only way of playing with the Z-Order of controls is by playing with the order of the controls inside the Form.Controls Collection. I find this solution very weird and weak and I'm looking for an alternative.
Does anyone has an idea? I just want to make some kind of modal dialog that'll show below another user control to notice the user that the user control is currently doing something.
Edit: I tried using Control.BringToFront() but it doesn't work at all.
Thanks a lot!
You're looking for the BringToFront() method.

Problem with Me.Dispose and Me.Close

In certain forms I am having problems with my code. For example when I call frmTwo from frmOne, and want to close frmOne before frmTwo is shown, it does not work. I used code
(In frmOne I wrote)
Me.Dispose
frmTwo.Showdialoge()
frmOne closes but frmTwo does not appear.
If I do it otherwise,
frmTwo.Showdialoge()</pre>
Me.Dispose
In this case frmOne keeps running in the background, that I donot want.
Please advise how to manage it.
Thanks and best regards,
Furqan
It sounds like frmOne is marked as your main form. To accomplish what you wish to do you might try the following...
frmOne.Hide()
frmTwo.ShowDialog()
frmOne.Close()
That code will close the first form after the second form's dialog closes. If you are simply seeking to hide the first form, and then present it again after the second form has been closed, then you will want to use the following code instead...
frmOne.Hide()
frmTwo.ShowDialog()
frmOne.Show()
In addition to what recursion posted above, my understanding is tht the .close method of a form disposes of the form as well. Second, I don't think you can call Me.Dispose (can an object commit suicide?).
I can't check this out at the moment. However, beyond this minor elaboration, recusrion is on the money with his suggestions.

Hide main form initially...Possible? (VB language)

Is there a way to start a Windows Forms in (VB language) application with the main window not visible? Then later on when an external event occurs, I want to display the form.
How can I accomplish this?
Thanks.
Hint: See the 'Visible' property.
Initially you just put:
Load SuperAmazingForm
..then when you want to display the form, simply call its Show method as normal.
Doing it this way allows you to interact with the form's objects without the user being aware of it.
It depends on if you are doing this in Excel/Word or Access. If you are using Excel/Word then the Load MyForm syntax works. However, Access uses it's own variation of the standard UserForm. To load a form hidden you can do:DoCmd.OpenForm "MyAccessForm", WindowMode:=acHidden.