For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have a window with 2 anchorable panes (one left and one at the bottom) and a documentPane. I use MVVM.
So I set the DocumentsSource and AnchorablesSource properties of DockingManager. The collection in AnchorablesSource
only binds to the left anchorable pane. I do not how to bind models to the second anchorable
How do I have to set up the xaml so that I have control over the binding of the anchorable panes?
There is a timer that moves the InnerCanvas to the left at regular intervals. This is Live mode.
The Now line is a child of the InnerCanvas, so that when the user slides it, the Now line will move also. Once the user slides the InnerCanvas, the control is then in History Mode. A History line appears when the Now line is and the Now line moves right with the timer ticks. So basically the user can see where Now WAS and where it IS relative to the slide amount.
In addition, in Live Mode, when the Now line is 3/4 of the way into the current period (1 Day, 3 Days, 5 Days), then an additional period is added to the right.
The problem is that in Live Mode, the now line should ALWAYS be 200 relative to the right side of the OutterCanvas.
There's got to be a way to know, regardless of the size or position of the InnerCanvas, to position it there.
My first pass was this
privatevoid setupNowLine(double distanceToMove = 0)
// Get the left of the inner container
double left = Canvas.GetLeft(innerCanvas);
if (distanceToMove == 0)
distanceToMove = left - originalInnerCanvasLeft;
// Recalulcate the new position
nowLinePosition = (INNER_CANVAS_WIDTH + distanceToMove) - NOW_LINE_POSITION;
// Position the Now line
But it doesn't work. For the life of me I can't get the calculations right. I could use some help here.
I am working on WPF app and got stucked on below items, any help would be greatly appreciated.
1) I am using usercontrol (do not want to use window) and want to stop resizing of it but cannot see any property. please help me in achieving the same.
2) I have a Grid having rowdefinitions and columndefinitions which is containing multiple button inside it. my task is whenever i am setting the visibility of any button to false that cell space should get released and next button should overcome this position.
Sorry , my bad , actually i alter this to set as an example and forget to change the value. Yes you're correct it should be 1. so , bascally i am having 2,2 grid with buttons on every cell. Now please suggest how can i use collapsed property on cell . Thanks
So if I am correct in understanding, you have a UserControl that is a button that you want to place in Grid.Row 2. Judging by the HorizontalAlignment="Left" and the Vertical Alignment="Center", this button is going to be placed in this grid along with some other control and you want them aligned and not to resize?
1) Grid.Row="0" is the first row, Grid.Row="1" would be the second row, and since there are only 2 rows defined in the definition, I think the first step is to make it Grid.Row="1". Also, If there is nothing in Grid.Row="0" then the Auto deceleration would essentially be empty, and no space taken up.
2) VerticalAlignment="Center" and HorizontalAlignment="Left" are not going to be valid unless there are other controls inside this grid along with the usercontrol, otherwise the Auto will size the width and height to the control. Having said that, if there is indeed another control that is taller and wider than this control, inside the same grid space, then indeed this would need to be set. Also, if there is more than one control you will need some kind of arrangement control such as a StackPanel to place them. For example:
Next I am guessing you have a property bound to the visibility that changes the visibility of your button; however, just to illustrate my point, if you were to set the visibility property to collapsed, the space should release. Such as:
Hope this is what you were looking for! Again I am making a few assumptions, so if I am not answering what you are asking, if you could be more specific I would be happy to continue to try and assist you!
Thanks for your time to look into my problem and come up with above solution. Unfortuantely this is not what i am looking for , as i have replied to kerry :
i am having 2,2 size grid holding buttons on all cell, when i make any of the button invisible , i want to release that cell space but collapsed not working here . i hope you got my problem now.
Ok, yes I think I understand a little better now, so you have a 2 x 2 grid, each has a button in it. When one of those buttons is set to collapsed you want the grid space to be released. Here is the solution I have come up with.
Thank you, this did help me to get a visual of what you are trying to accomplish. I still have one question and that is, the only buttons that you want to change the visibility on are the 8 buttons in the middle of your control correct? Under that assumption I have come up with a solution that I believe meets your requirements.
I made a User Control with the design height at 500 and the design width at 300 which allowed me to fit all your controls in the window and keep the same arrangement scheme that you provided.
Next, I created 3 rows and seperated your controls into the 3 Sections. The top controls will go in the first StackPanel like this:
The WrapPanel is where I host your 8 buttons, and the StackPanels will host your other controls.
Save To Draft
Lowest Height Control
Send for QC
Maintain Scheme Checklist
Configure Storey Heights
This WrapPanel will cause your controls to take up the space that the collapsed button used to occupy and will move up rows if there is enough space on the row above it. The width of the WrapPanel will determine how many buttons per row as the buttons will fill in horizontally before moving down to the next row, this is possibly the reason for the vertical alignment you previously mentioned.
And Finally You can put your Last Section in another StackPanel:
//m_windowUI.MaximumSize = new System.Drawing.Size(305, 500);
This will only set the maximum size of the element host so that you can not size it any larger than this size. The same rule will apply to MinimumSize, it will not size any smaller than that size.
m_windowUI.Size = new System.Drawing.Size(305,500);
is the event that I believe you are looking for. It has been a while since I worked with windows forms, but I believe when you set the size of a control it will not resize when the window does.
I suppose you could set a minimum and maximum that are the same size, but the real thing to understand here is that both the user control and the element host inherit from Control, so they should both be thought of as controls inside a window.
Again it has been a while since I worked with Windows.Forms, but I will create a little dummy project and see if I can't find a solution, but hopefully these suggestions might get you on the right track.
If you could help me get a visual of what I need to recreate... Windows.Forms Window, element host, then WPF UserControl. The UserControl is in the element host that is docked inside a window with other winforms controls? or is the usercontrol hosted by itself inside the window?
Well, threading isn't going to do anything. Creating an instance of the control cannot be done on a separate thread. It has to done on the UI (startup) thread since the form you're going to stick the control to is on the UI thread.
Really, you HAVE to do root cause analysis here. Is it the creation of the control that is slow or is it retrieving data that the control is going to use that is slow?
If it's the creation of the control there's nothing you can do about it.
Not sure what you are doing with your control, but if it was like a Status bar or similar, Id either use RowDefinitions or a DockPanel to set it at the bottom. But without any code, or an exact explanation of what you want to achieve its hard to give you any better advice.
On Runtime if you would like to change the height of the control, then all you would need to do is change the height of the Grid. By doing this you keep your control inside the bounds of the grid, yet if the grid height changes, so will the control since the property is set to stretch.
I need a quick advice on following. Please help me out..
I am using following searchtextbox in my WPF application usercontrol and successfully able to reference it. I can see the searchtextbox on my usercontrol but i don't know how to use its functions, i mean how to bind this with list of data ? Following url only explained about customized textbox but not on how to consume and use it? Please help me on this . thanks
I take it that you are referring to this blog post[^]. The chances of someone here, just knowing how that works, is very slim. What you are asking is for someone to download the control, integrate it into an application and then figure out how it works. That seems like you're expecting us to do an awful lot of your research for you. That's not going to happen.
I am trying to determine if I can do a particular project in Windows phone/store or not.
I need to take a given video file, extract the audio in wave format, do some processing and put it back in the video.
Do you think this is an easy/feasible task to do? In this case, would you give me some key words (name of the library, Programming language) or anything else that I can use to narrow down my search?
I'm not trying to be funny. You asked how easy it was, and I gave you an answer based on what we know about your skills, which is nothing. You asked for some keywords and I gave you some; have you tried using them?
This is definitely not a trivial task, and certainly not something I'd look to jump into as there really aren't any built in libraries. Part of the problem is that there are so many codecs and formats for videos that you have a lot of work there. What you could do is search for PCL extract audio from video in Google. A quick scan shows at least one library for dealing with FLV files - I haven't had a real chance to look into what platforms it targets, but it should serve as a good starting point.
I'm tasked with implementing mapping in an app I'm working on. Currently we have a WinForms app that does mapping but it's a beast and is spread across 8 projects. I'm hoping someone here has experience with mapping.
Must be usable in WPF
Must handle offline maps. Out map files are in NITF format.
Can someone point me in the right direction? Get me started please?
I'm looking at Gmap.Net[^] but I don't know what it does or how it works yet.
Kevin - what mapping component do you currently use in your WinForms app? Looking at the GMap.NET comments gives me an uneasy feeling about the authors approach to working with mapping providers. Looking at the comments from the Google and Bing map teams, and how the author is ignoring their functionality take-down requests would make me uneasy about relying on the component, especially as you could end up running afoul of the providers constraints - leaving you facing potentially very damaging reputational issues.
i'm very impressed by some web site performing scroll based animation using jquery or other framework like scrollmagic but no such thing for a simple presentation in c#/WPF ?
how can i achieve some simple example in wpf ? is there some sample around achieving scroll based animation ?
If you're talking about the demo of ScrollMagic moving an element from one area of the screen to another, a simple path animation should do the trick (note that you can position elements outside the visible area of the window so the animation could appear to make the element appear as if by magic).
doing animation is fine but how can i trigger a animation attached to a control inside a scrollviewer based on a define start position for example
lest assume a rectangle with a scale animation inside a scrollviewer
i want be able to triggering that scale animation when scrollviewer.offset reach a certain value
like many jquery scroll based animation do
I have simple List<string>.
I need to define Table that each column of this table is one of this list elements.
So i will use ListView - I need to define a ListView that each column of this ListView is one of my List<string> => that mean that the
first column name is List<string>
second column name is List<string>
I can't fine any way to do it.
I google it and all the examples are shown how to create dynamic rows
Any help please ...
I am currently working on a cbt software and i want the questions to be coming randomly ( one per page) which is working. Please how can i program Previous and Next button with WPF of VB.NET so user can skip and later go back before the exam finishes. Please help me. Have been on it for like 3 weeks now. thank you
Last Visit: 31-Dec-99 18:00 Last Update: 3-Oct-15 20:02