|
I have one MFC control,which one i create, and I convert this as a .dll file and add a System::Windows::Forms::UserControl to this dll and whit the help of this Usercontrol I can load this control in WinForm application.
I need to use this control in WPF application, with out using the System::Windows::Forms, So, i think, I need to add a System::Window::Controls::UserControl to the dll and convert this as a UIElement^. But I have no idea how to do this. If you have some idea, or any help pages in internet, how to create a System::Window::Controls::UserControl from a MFC dll please help me.
|
|
|
|
|
|
I have a datagrid with a DataGridTemplateColumn. The DataTemplate is a Image wrapped by a Button.
<wpftoolkit:DataGridTemplateColumn Header="Search Type" IsReadOnly="True" >
<wpftoolkit:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button x:Name="btn" Width="25" Height="25" >
<Image x:Name="icoDisplay" Source="../Resources/plus.png"></Image>
</Button>
</DataTemplate>
</wpftoolkit:DataGridTemplateColumn.CellTemplate>
</wpftoolkit:DataGridTemplateColumn>
I'm trying to change the image source when a row is selected. I want to show an image with a "+" when the details for a row are not showing. I want to show an image with a "-" when the details for a row are showing. I want to change the image source when the row is selected in any cell of the row, not just when the button/image are selected. I don't have to have the button there if it can be done without it.
Any help with this would be greatly appreciated.
|
|
|
|
|
Hi,
I have a WPF DataGrid (from WPFToolkit) which dispays the results of several queries from a database.
I am returning the results to a datatable and then setting the DataContext of the DataGrid to = the DataTable, so no Binding.
I need to programatically format the "StringFormat" of each column at runtime ie. for Date - "dd MM yyyy" etc.
This is very easy to do with a normal windows forms DataGridView but looks to be nearly impossible to do with the WPF Datagrid.
I cannot create the columns in XAML as I do not know what they will be, every query is different and can change what it returns.
I have spent 2 days trying to resolve this issue, and have not found a single post which actually solves this problem.
Any help would be much appreciated.
Thanks
|
|
|
|
|
Just Use AutoGeneratedColumns Event of the DataGrid:-
In the below mentioned example DataGrid Name is "dgvTimming"
void dgvTimming_AutoGeneratedColumns(object sender, EventArgs e)
{
foreach (DataGridColumn item in dgvTimming.Columns)
{
switch (item.Header.ToString())
{
case "Plan_Timing":
item.Header = "Plan Timing";
break;
case "Pacesetter":
case "Contingent":
if (item.GetType().ToString() == "Microsoft.Windows.Controls.DataGridTextColumn")
{
DataGridTextColumn dg = (DataGridTextColumn)item;
dg.Binding.StringFormat = "C";
}
if (item.Header.ToString() == "Contingent")
item.IsReadOnly = true;
break;
}
}
}
Yogesh Sharma
|
|
|
|
|
hi
i work somewhere as a programmer
i know somethings in c#
and you know i want to use the WPF
and want to know where should i start it
please tell me which book,tutorial or other material is the best start line for an absolute beginner in WPF
thank you all that kindly help me to be improved and so be happy
just improvement cause real happiness
thank you everybody
|
|
|
|
|
here the book name
Sams - Teach Yourself WPF in 24 Hours
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
|
How do I go about adding a 'Command' property to a custom WPF control derived from an existing control? I want to use the Command property the same way you would use a Command property on a button--to bind to any ICommand or routed command.
I rely heavily on MVVM, and my UI controls are almost always bound to ICommand objects in my view model. I have started using the Actipro Wizard control for my WPF wizards, and it's very good. But it's missing one thing: It won't let you bind a command to the activation of a wizard page.
In many wizards, a process should start automatically when a wizard page is activated. For example, in a file copy wizard, pages 1 and 2 get file paths from the user, and when the user advances to page 3, the copy should begin automatically, displaying a progress bar for the operation.
Unfortunately, the Actipro WizardPage doesn't have a Command property that fires a command when the page is activated. It does have a 'Selected' event, which I'm using now. But I would rather bind to a command in XAML, so I am extending the ActiPro WizardPage control to add a 'Command' property that will fire when the page is activated.
Can anyone point me to any articles or blogs on how to implement a 'Command' property and give the derived control the CanExecute() behavior expected of a command-bound control? Thanks.
David Veeneman
Foresight Systems
|
|
|
|
|
Found my answer. A derived control that wants to implement a Command property must implement the ICommandSource interface. There is an MSDN article[^] that shows how to do it, as well as a code sample[^].
David Veeneman
Foresight Systems
|
|
|
|
|
Hi,
I have a WPF textbox and I want to validate the text the user types i.e. only numbers are allowed. To do this I have set
<pre>Text="{Binding MobileNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}</pre>
And the property is
<pre> public string MobileNumber {
get {
return mobileNumber;
}
set
{
if (AllowedPhoneNumberCharacter(value))
mobileNumber = value;
OnPropertyChanged("MobileNumber");
}
}</pre>
If the user types a character we came to <i>set </i> and after OnPropertyChanged("MobileNumber"); a call to <i>get </i>is made. But the textbox is not updated, why?
Example:
09876 :User types o phone number. OK
098767 :User adda a digit 7. OK
098767g :Not OK to add g. Now I want to update textbox with 098767.
Regards
Marc
|
|
|
|
|
I believe the PropertyChanged is not fired until the user leaves the textbox. I believe you have to process the KeyDown events to get that kind of control. You can check to see if the key is an alpha character. If the key is an alpha then set the e.Handled property to true and the keystroke won't go the text area.
My 2 cents,
Richard
|
|
|
|
|
Dear friends
any body help me to host silverlight project from local host(Step by Step Processors).
I have got lots of link but that are not help full . that very confusing in virtual directory and MIME Type. that link are not sufficient to understand of deployment of Silver Light Project please help me
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
This question is really outside the scope of Silverlight.
Silverlight runs via a plugin hosted on a web page in a browser.
You need to know how to publish that web page.
That means you need an HTTP (web) server, like IIS, Apache, etc.
You should really ask on the web development board.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Then how we access silverlight application from different system or Computer?
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Piyush Vardhan Singh wrote: how we access silverlight application from different system or Computer?
The same way you access any web site.
Really, what you need to know is how to publish a website - it
will make sense when you know that.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
My Dear Friend
Thanks for continue reply....
supposed that my silver light application Url :-
URL:-http://localhost:2328/FileConversionTestPage.aspx
its work perfectly on my machine.it did not access through IP from different Machine and my machine.
URL:-http://192.168.12.5:2328/FileConversionTestPage.aspx
I also Create virtual Directory it also work Url:-
http://localhost/FileConversion/FileConversion.Web/FileConversionTestPage.html
http://192.168.12.5/FileConversion/FileConversion.Web/FileConversionTestPage.html
from my computer main page is open but when web services connection is going to connect then its give the Error:-
System.reflection.targetInvocationException:....... remote server returned an error:Not Found
it also did not access from different machine URL;-
http://192.168.12.5/FileConversion/FileConversion.Web/FileConversionTestPage.html
So I Want access my this Url:-
http://localhost:2328/FileConversionTestPage.aspx
From different machine. Please Help me to resolve my problem.
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Piyush Vardhan Singh wrote: So I Want access my this Url:-
http://localhost:2328/FileConversionTestPage.aspx
From different machine. Please Help me to resolve my problem.
You need to figure out what the actual URL is for the web server you're hosting
on.
Again, this has nothing to do with Silverlight and you really should be asking on
a web development board.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i want know only one thing how to host silverlight project from my local host for every body in company.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
Eventure Technology
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
|
Hi,I want curve in all corners of textbox in wpf..
I got this by following code in dynamic resource.
But from that i can't input anything in textbox.
Any Suggessions?
<Style x:Key="UserNameTextBox" TargetType="{x:Type TextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBoxBase}">
<Border Name="Border" Background="#FFEBE9E9" BorderBrush="#FF8B8787" BorderThickness="1" CornerRadius="3" Padding="3"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
|
|
|
|
|
This should work,
<Style x:Key="UserNameTextBox" TargetType="{x:Type TextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBoxBase}">
<Border Name="Border" Background="#FFEBE9E9" BorderBrush="#FF8B8787" BorderThickness="1" CornerRadius="3" Padding="3">
<ScrollViewer x:Name="PART_ContentHost"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
|
|
|
|
|
Thanks a lot..
Can you please explain shortly about,
<ScrollViewer x:Name="PART_ContentHost"/>
|
|
|
|
|
The ControlTemplate for a TextBox must contain exactly one element that is tagged as the content host element; this element will be used to render the contents of the TextBox. To tag an element as the content host, assign it the special name PART_ContentHost. The content host element must be either a ScrollViewer or an AdornerDecorator. The content host element may not host any child elements.
From here, MSDN[^]
|
|
|
|
|
Windows 7 has this wonderful Thmbnail view of open windows when you hover over icons on the taskbar > http://windows7news.com/windows-7-screenshots/?album=1&gallery=13&pid=287
I'm trying to add the same functionality to a WPF application that allows the user to see thumbnails of static and dynamic forms when not loaded but also thumbnails of forms that are open and loaded with data.
Anyone have any ideas on achieving this functionality?
|
|
|
|