AxWindowsMediaPlayer size in WPF applications - c#

I am using an AxWindowsMediaPlayer in a WindowsFormsHost in a WPF application.
I'm having problems with sizing the control.
I need to hide the video part, and keep only the part with buttons and seek bar. (since I run audio)
I need to adjust the WindowsFormsHost to only display this part.
I tried to resize the WindowsFormsHost manually so that it only shows the required part, but when I tested the program on different pc's it wasn't displayed properly. Some parts from the control were cropped.

I know you want to hide the video with the uiMOde
awWindowsMediaPlayer.uiMode= "invisible";
But, this hide controls too...
For me, you have two solutions:
the first, you create your axWindowsPlayer form with 45pixel of height for display just the controls button.
the seconds, you hide all the form, and create all your button...
you've acces at the controls button with : (play button for sample)
axWindowsMediaPlayer.Ctlcontrols.play();
And you've acces to the settings with : (volume for sample)
axWindowsMediaPlayer.settings.volume = 25;
I also saw that it was possible to define a custom uiMode, but I did not find any information about that...

You have two options.
Set uiMode to invisible and define your own buttons (functions are accesable like: axWindowsMediaPlayer.Ctlcontrols.stop();).
Set uiMode to mini or full and set height 40. It leaves control without video visible (link: http://msdn.microsoft.com/en-us/library/windows/desktop/dd562469%28v=vs.85%29.aspx)

You can also hide status, bar and controls
axWindowsMediaPlayer.uiMode= "None";

Related

WinForms UserControl gets cut off when running

I'm having a lot of difficulty with WinForms and sizing of user controls. We've got a DataGrid, with some buttons underneath it, in a custom User Control.
Everything is anchored correctly. As in, when you resize the control, the buttons stay anchored to their proper sides, and the data grid fills the rest.
It even works when adding it to our main form:
Then, when we run the app, it gets cut off:
I've tried:
Docking
Anchoring
Changing the AutoSize property of the control, and the control as used in the main form
But nothing is getting it to act like it does in the designer.
Any help is really appreciated.
Use Split Container and put dataGridView on top and bottom insert your buttons and set Panel that is in bottom Fixed.
Another option is to use TableLayoutPanel
More information :
Designing the Layout of Windows Forms using a TableLayoutPanel, with auto-expand panels
There were obvious issues with the WinForms app, WRT scaling and fonts. We switched over to WPF and everything is working as expected.

C# WebBrowser anchoring

So I am working on a browser using Visual Studio 2013 C# Windows Forms Application. I want to have 2 WebBrowser Object opened in the same time, in the same application, however if I try to anchor them they look like so:
The first one is anchored to left top bottom and the second one is right top bottom, if I anchor them on the other side too to cover the rest of the screen one WebBrowser goes above the other one so only one is visible now and fullscreen however I would like to have them together each one covering the other half of the screen.
Thanks for your time!
The most simple approach would be using a TableLayoutPanel control having two columns which width of them set to 50%. Then it's enough to put each WebBrowser control in a cell and set Dock property of browsers to Fill. This way each browser will occupy half of the form in any size. Also the Dock property of table layout panel should be set to fill the form.
For more information about TableLayoutPanel:
TableLayoutPanel Control Overview

c# - How to arrange elements in WindowsForm like Windows Explorer

I'm populating a self-made Windows Explorer which simulate the Microsoft Windows Explorer. This is the layout of my Windows Form:
What I want it to be is:
But when I maximized the windows, it looks like this:
The problem is that the treeView's width got increased, too. How to stop that ?
Any ideas? I've tried many ways but nothing works.
Try to add a second splitcontainer around the groupbox and the splitcontainer you already have. Then set the panel at the bottom as the fixed panel.
You can set the SplitContainer.FixedPanel property to disable automatic resizing of one of the panels. This way the specified panel will remain the same width/height even when the container itself is resized.
You could use Anchoring (each control will have that in the Properties menu), and select what you want it "anchored" to. That should allow your controls to stetch to fit the form.
It can be fiddly, so you have to anchor each control and think about how to wish to set it. EG to make a control extend if you increase the height of your form, click the top and bottom anchors.

Advantages of popup over panels in Windows Phone

I'm curious about Popup control in Windows Phone. For me, it's some kind of panel, that has IsOpen property. And I should used it, when i want to present some only in some defined context (e.g. button pressed).
But why not use just normal stack, or grid panel, and when use Visiblity when you want to hide, or show it? It's seems to behave the same.
You can change the Horizontal and Vertical position of the popup using the HorizontalOffset /VerticalOffset properties in the Popup control. We don't have that option in the Grid and to other panels.
It is an overlay. It doesn't break page layout as it shows above the main content.
While StackPanel or Grid should be added to main content and when they are shown they'll move other controls down.

How can I assign a custom backcolor or background image to a TabPage control?

How can I assign a background image to tabpage control in Visual Studio C# 2010? I am able to provide background image to each of the tab separately, but I cannot do it so for the whole tabpage control, due to which a portion of tabpage control remain with different background and each of the tab pages has ok and fine background.
Here is the picture of my form:
See the 'grey-colored' region in the tabs line. How can I cover the whole tabpage control with one single background?
The header area that contains the tabs is not part of your tab page. It's part of the parent TabControl, which is automatically drawn for you by Windows.
If you want to change how it looks, you'll have to draw it yourself. That's called owner-drawing, and it's not exactly a trivial undertaking, especially for a complicated control like this one. For starters, you can't just use OwnerDrawFixed, because that just allows you to custom draw the contents of the tabs (for example, to change the font). You will need to owner draw the entire tab control.
I can't imagine a good reason that you would ever want do this, but you'll find a few samples online that might help get you started. For example:
http://homepage.ntlworld.com/mdaudi100/alternate/tabcontrols.html
http://www.codeproject.com/KB/tabs/flattabcontrol.aspx

Categories