Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
My project has a button which when pressed executes the following code:
dim mywin as New MyDialogWindow()
mywin.showactivated = false
mywin.show()
My dialog window pops up, although showactivated was set to false.
I looked into Microsoft help and found:
Dim window As New AWindow()
window.ShowActivated = False
window.Show()
My code seems to be the same as Microsoft's code.
Does somebody know what's wrong with showactivated?
EDIT:
I posed this question with code (above) AND behaviour (pop up of my window), which I thought was strange because I erroneously believed that "showactivated" means the window is put into view. Meanwhile I was told the true meaning of showactivated and my question was answered.
ShowActivated does not hide the Window; it will prevent the Window from receiving focus.
From the MSDN:
When a window with its ShowActivated property set to false is opened,
the window is not activated and its Activated event is not raised
until a user manually activates the window by selecting it. After the
window is selected, it activates and deactivates normally.
So the Activated event is not raised. The Activated event causes a window to become the foreground window and receive focus.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 months ago.
Improve this question
Maybe this can't be answered without context but when I use Show():
TestView test = new TestView()
{
Owner = Application.Current.MainWindow
};
test.Show();
Everything works fine, the events are fired and my textbox/comboboxes are populated with data on the test view. But when I use ShowDialog() nothing is populated. Anyone know a reason why? I want a modal window.
This is by design.
As by documentation:
When a Window class is instantiated, it is not visible by default. ShowDialog shows the window, disables all other windows in the application, and returns only when the window is closed. This type of window is known as a modal window.
Modal windows are primarily used as dialog boxes. A dialog box is a special type of window that applications use to interact with users to complete tasks, such as opening files or printing documents. Dialog boxes commonly allow users to accept or cancel the task for which they were shown before the dialog box is closed.
Thus, the ShowDialog is blocking until the window is closed.
This means that dealing with events and similar, specifically from the Owner window will not work.
If you have additional questions, please show the relevant code with the events and how you populate them.
If for some reason you need a full blocking window - it is possible; but we will need more details.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I had search on scroll bar not appearing topic.
i believed my problem is the same as others but the solution but it seems none of them help.
I had a few button which i create in design stage within a panel, when some button are out of the area of the panel, the IDE does show the scrollbar which i set Autoscroll to True.
However during runtime, i cannot see any scroll bar nor can i scroll into those control that is out of the area of the panel
I tried Anchor the buttons all around and it does not help. Setting AutoScrollMinSize to a large value also does not help.
Am i missing other ways?
**Edit
Attached is a picture i snapshot during design and runtime
try Setting Panel AutoScrollMinSize
panel1.AutoScrollMinSize = new Size(0, 10); // 10 or Minimum Height you require
If the above also didnt work check the tab order and make the panel to be on the top most parent.
I feel you are making some changes in runtime. Your Design-time Screenshot and runtime screen seems to have background difference, try setting AutoScrollMinSize again after setting background
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am having an usercontrol.Intially i am collapsing the visibilty of that control.Once I make the control visible , the loaded event of the control is not getting called
The Loaded event is not raised when you change UserControl's Visibility property.
You can use IsVisibleChanged instead.
A useful remark about setting Visibility property and IsVisibleChanged event from MSDN:
Setting this property affects the value of IsVisible, which in turn may raise the IsVisibleChanged event. However, IsVisible has other factors that influence it, for instance the visibility settings of parents that contain it.
This question already has answers here:
Determining when a WPF window is being moved
(3 answers)
Closed 7 years ago.
In need to get whether or not my WPF application's Window is currently in the process of being dragged or re-sized. I need to prevent a specific action from happening if this is the case.
I need to check if the window is currently in any situation where the mouse is being held down on the the part of the window that can preposition it.
I am assuming there is probably some information somewhere on the
Application.Current.MainWindow
property. Or maybe there is a few events that I need to keep track of to have this information.
Any ideas how I would do this? Thanks in advance.
Subscribe to the LocationChanged event.
Set the ResizeBegin and ResizeEnd event. They should both fire when the application is being moved, and disable your feature when Begin is called and until End finishes.
EDIT: Just realized this is WPF, in which case check this article: Determining when a WPF window is being moved
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Could anyone explain me how the compiler knows to perform appropriate method when we select RadioButtons in this example ?
It's hard to say for sure what you're asking. I think you're asking how the system knows that it should execute the iconType_CheckChanged method when one of the icon radio buttons is clicked, and how it knows that, for example, the asteriskRadioButton changed.
The answer is in two parts. First, in creating the program in Windows Forms, you hooked up the CheckChanged event handler for each of the radio buttons. So the asteriskRadioButton CheckChanged method contains the value iconType_CheckChanged. That information is added to the partial class that you don't usually see. It's in your Form.Designer.cs file in the InitializeComponent method. It looks something like:
this.asteriskRadioButton.CheckChanged += iconType_CheckChanged
You don't typically see the Form.Designer.cs file. To view it, expand the form node in the Visual Studio Solution Explorer and you'll see the file listed:
The second part of the answer is that when you click the radio button (or when some code changes the state of the radio button), the underlying control machinery calls iconType_CheckChanged, passing a reference to the control that triggered the event in the Sender argument.