|
You need to add the WindowsFormsIntegration namespace to your project. For more info, google "WPF Winforms integration". There are many good examples out there..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
thanks John for ur quick reply
can you please provide me some helpful links
actually i searched a lot but didnt found any apropriate solutionabhinav
|
|
|
|
|
Well, I don't know what you want to do (and I don't really care), so you're going to have to come up with your own google phrase. The one I provided is merely a starting point.
Besides that, if you're not actually co-mingling winforms controls on a WPF form (or the other way around), there really is no magic involved that I can think of. Just create the winforms form and be done with it..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John, if you want to know just read his post. It's very simple to read and very simple to understand (or do not make this kind of answer). This is a very specific problem and google will not help.
And abhinav the WindowsFormsIntegration.dll cannot help you for your problem.
Just try to listen Application.Current.Activated and Deactivated event to change the TopMost value of the form. I guess it can be a good beginning...
Need help ? Ask me
|
|
|
|
|
Hi,
I'm new to Threading and WPF and need some help Adding to my Combo Box. I Understand I can't touch the UI from a background thread I just cant seem to figure out the work around. I got This Far. You'll see a Combo1.Items.Add(f); That is throwing.
If I can get a good example of how you are suppose to do something like this I'll have a chunk of code I can play with and learn from.
Thank you very much For any help
private void button1_Click(object sender, RoutedEventArgs e)
{
string Server;
Server = cmdServers.SelectedItem.ToString();
FillApplicationCombo(Server);
}
void FillApplicationCombo( string Server)
{
int count;
string Path;
int Version;
string AppName;
Path = @"\\" + Server + @"\" + "DOCFOCUS";
progressBar1.Minimum = 0;
progressBar1.Maximum = _DirectoryFiles.Count;
_Worker = new BackgroundWorker();
_Worker.WorkerReportsProgress = true;
_Worker.WorkerSupportsCancellation = true;
_Worker.DoWork += (s, args) =>
{
BackgroundWorker worker = s as BackgroundWorker;
DirSearch(Path);
count = 0;
foreach (string f in _DirectoryFiles)
{
count++;
worker.ReportProgress(count);
AppName = FileVersionInfo.GetVersionInfo(f).ProductName;
if (AppName == null)
continue;
if (AppName.ToUpper().IndexOf("MYAPPNAME") == -1)
continue;
Version = FileVersionInfo.GetVersionInfo(f).ProductMajorPart;
if (Version == 6)
{
Combo1.Items.Add(f);
}
}
};
_Worker.RunWorkerCompleted += (s, args) =>
{
progressBar1.Value = 0;
};
_Worker.ProgressChanged += (s, args) =>
{
progressBar1.Value = args.ProgressPercentage;
};
_Worker.RunWorkerAsync();
} Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
You have to setup a delegate,
private delegate void DelegateUpdateCombo();
create a method that matches it,
private void MyMethod()
{
}
and then use this in your thread event handler:
DelegateUpdateCombo method = new DelegateUpdateCombo(MyMethod);
comboBox.Dispatcher.Invoke(myMethod); .45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks. That did it Ronald Hahn, CNT - Computer Engineering Technologist
|
|
|
|
|
|
You can easily add external resources in. All you need to do is use the special syntax for loading XAML from external resources. Here's an example of creating 3 resource dictionary entries from 2 DLLs (one called MyOtherAssembly, the other called YetAnotherAssembly):
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MyOtherAssembly;component/ResourceDictionary1.xaml" />
<ResourceDictionary Source="/MyOtherAssembly;component/ResourceDictionary2.xaml" />
<ResourceDictionary Source="/YetAnotherAssembly;component/ResourceDictionary1.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary> "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
Check to see what namespaces you have in there."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I found no answer to this problem yet.
I have a Collection with customer data. One of the properties of the customer class is a collection of addresses. I can bind these collection of addresses to a combobox or listbox with the ItemsSource property.
But what I really want to do is bind some of these addresses to different textboxes. ex:
TextBox1.Text="{binding Customer.Addresses.Address[0]}"
TextBox2.Text="{binding Customer.Addresses.Address[1]}"
...
I hope this is possible...
Also is it possible to sort or filter in this binding scenario?
Many thanks for your thoughts.
|
|
|
|
|
ddecoy wrote: TextBox1.Text="{binding Customer.Addresses.Address[0]}"
TextBox2.Text="{binding Customer.Addresses.Address[1]}"
I suspect you mean this:
<TextBox Text="{Binding Customer.Addresses[0].Address}" />
<TextBox Text="{binding Customer.Addresses[1].Address}" /> "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Yes.
But is it possible ?
|
|
|
|
|
Dear Friends.
I want to make a custom control for wpf that a custom combobox. I need to change combobox item drawing. how can I change it from code or access to XAML code of combobox in custom control project.
(I'm using this code for inherit combobox:
Public Class CustomControl1
Inherits ComboBox
)Regards.
Mehdi Ghiasi
|
|
|
|
|
Generally if you think that you want to change the appearance/behaviour of a control in XAML by creating a subclass, this means that you're approaching the problem in the wrong way. As the standard WPF controls are "lookless", this means that you can change the template to suit your own purposes.
The only time that you should even consider inheriting is if you want to radically alter the behaviour of the underlying control - in other cases, you could consider implementing the functionality with Attached Properties/Attached Behaviours."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
So, How can I make a Color Picker Combo Box (Color Picker Drop Down list) for my WPF Application? (I can make it in my program with both XAML and code. but in a class, I haven't XAML, how can I Change ItemTemplate of ComboBox? I've made this control for windows forms with DrawItem Event.)Regards.
Mehdi Ghiasi
|
|
|
|
|
Dear Friends,
I have small Clarification with MVVM patten With Wpf
I have an User control "A.xaml" , and i am having all the Binding in ViewModel .. "AViewModel.cs" as septate class
i have no code in code behind file "a.cs"
now my problem is like these
in the user control i having 6 buttons, and i want property as "ButtonNo"
if i specify <Usercontrol:A ButtonNo =4/> in Main Window then i have to enable 1,2,3,4 buttons ...
( i know that by writing code in "a.cs" is possible .. but i do not want to write in code behind file .. i have to do it in "AViewModel.cs"
is it possible? if so how to do that?
)
Give me some idea..
By
Joe
|
|
|
|
|
=>Joe<= wrote: i have to do it in "AViewModel.cs
Why? There is no law that states "thou shalt not code in code behind". If there was, it would have been invented by an idiot. Now, you can enable the buttons in a VM just by using a command and bind the Enabled property of the button to the CanExecute property on the command. If you want to see what this looks like, you can take a look at my article here[^]."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi friends,
Is there any way to get UIElement from its binded property name in wpf?
What i want is to focus the first control on the form which has error(error means invalid information).
i am using IDataErrorInfo here.
Thanks.
|
|
|
|
|
I'm not aware of a simple way to achieve this. One way to do this would be to walk the Visual Tree, looking at the data binding on each element in the tree, and check to see if it has a binding that relates to the relevant property."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi everyone,
I am using Silverlight to create DashBoard. In one of my Dashboard i am using AgDataGrid(DevExpress.AgDataGrid) where it has datecolumn.
<grid:AgDataGridDateColumn FieldName="fldSODate" HeaderContent="Sales Order Date" PrepareCellDisplayElement="AgDataGridDateColumn_PrepareCellDisplayElement" >
<grid:AgDataGridDateColumn.CellDisplayTemplate>
<DataTemplate>
<TextBlock Text="{Binding CellValue, Converter={StaticResource DateConverter}, ConverterParameter=D}" />
</DataTemplate>
</grid:AgDataGridDateColumn.CellDisplayTemplate>
</grid:AgDataGridDateColumn>
</grid:AgDataGrid.Columns>
i have done the above thing but still this is not working when i view the grid. The reason to use this AgDataGrid for Grouping purpose.
Please help me .modified on Thursday, March 4, 2010 11:33 PM
|
|
|
|
|
Dear Friends.
I've making a wpf application. in a part of my program, I need some "windows forms" controls. I use WindowsFormsHost for using that controls. it work correctly, but the theme of controls (in windowsformshost) is windows classic. but I using Windows Aero (Windows 7).
Here is an Image of my Problem:
http://ghiasi.net/wpf.jpg[^]
How can i correct the theme of Windows Forms Controls in WPF Application?Regards.
Mehdi Ghiasi
|
|
|
|
|
Windows Forms controls use a different method of rendering to WPF (they use GDI+). If you want the forms to have the theme, you'll either have to invest in a 3rd party control that does this or write your own theme management. Alternatively, you could use native WPF controls; for instance the colour drop down will be easily achieved by setting the display template for the control to show a coloured rectangle with a textblock beside it. The numeric spin control is included in a MS sample here[^]."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
just call "System.Windows.Forms.Application.EnableVisualStyles();" in the constructor of your Window and it will fix it.
|
|
|
|