|
Santhapur wrote: Can any one please provide the code for this
No but I will give a hint, you are looking for ValidationRule
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Hi.
How to handle Tab Index changing in TabControl ?
Thanks in advance.
|
|
|
|
|
There is a SelectionChanged event that you can handle.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks Karl.
But how can I get Selected tab index ?
|
|
|
|
|
TabControl is like other ItemsControls. It has SelectedIndex, SelectedItem, and SelectedValue properties that you can use in your code, depending on what you are looking to do.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks Karl for a nice and quick response.
In WinForm we can get TebIndex :
void tabControl1_Selected(object sender, TabControlEventArgs e)
{
}
But in WPF I didn't find a thing like that :
private void TabControl_SelectionChanged(object sender,
SelectionChangedEventArgs e)
{
}
|
|
|
|
|
That is the event you need to handle.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks Karl.
Karl Shifflett wrote: That is the event you need to handle.
Yes, I understand.
But I want to get new SelectedIndex of tab when SelectedIndex changed ?
Do you understand what I mean ?
|
|
|
|
|
The below code assumes that my TabControl is named tcDemo.
You can also use the e.AddedItems property to get a list of selected items.
The way I'm doing it, is more direct.
Private Sub tcDemo_SelectionChanged(ByVal sender As Object, _
ByVal e As System.Windows.Controls.SelectionChangedEventArgs) Handles tcDemo.SelectionChanged
Dim objTabItem As TabItem = CType(Me.tcDemo.SelectedItem, TabItem)
End Sub
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks anyway.
I'm working C# and I couldn't understand your VB code well.
But I used this code and my problem solved.
void TabControl_SelectionChanged(object sender,
SelectionChangedEventArgs e)
{
MessageBox.Show(((TabControl)sender).SelectedIndex.ToString());
}
|
|
|
|
|
|
Wow
Great web site.
Thanks Karl.
I really need a something like it.
|
|
|
|
|
Me too! It helps me out a good bit. Glad it was helpful!
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi!
I'm trying to create a small program that allows to create,edit and print several slides. Idea is similar to PowerPoint, although much much simpler (only editable RichText and Images from files placed on the slide)
How can I do this? (FlowDocument won't work because fixed coords are necessary for all the elements)
I can think of using Canvas layout, dynamically destroying old controls(Saving the edited text and links to images to some internal structure) and creating-placing new EditText and Image controls each time user clicks Next or Previous slide buttons(filling them with data from saved internal data).
But how do I allow zooming of this canvas with controls so that if user zooms in, scroll bars appear, text and image controls enlarge correctly like in any Office App.
Will I be able then to print this canvas with all the controls on it?
Is there a better way to do this?
Thanks!
|
|
|
|
|
Have you tried the RTF control? There is a great example in the SDK examples.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi All,
I'm currently implementing some commands on Views / Controllers in a WPF app but I'm seeing something I didn't expect with the DelegateCommand. My Can<insert command name> only gets called once during the initial 'setup' of the view. So for instance the app gets loaded, all the Can whatever commands get called and setup various things, but when a command is raised and the state of the return values from these CanExecute switch the UI doesn't respond ... I expected them to operate more like 'normal' WPF command bindings.
Anyone have any ideas?
|
|
|
|
|
Fixed this!
|
|
|
|
|
Hi,
Can we use DirectX in silevrlight as in WPF?
If it is possible, can anybody help me by giving simple sample
Thanks in advance
Soni
|
|
|
|
|
Member 4694627 wrote: Can we use DirectX in silevrlight as in WPF?
You can't. Silverlight has been designed to be cross platform, and DirectX is platform specific.
|
|
|
|
|
|
Hi,
Im using framework3.5 WPF using C#,i have designed with three main menus namely client,product and order this menu is designed in mainform and im having client.xaml,product.xaml and order.xaml. in main form im having stackpanel.when im clicking the client menu the client.xaml form it should be open within the mainform stackpanel and product,order correspondigly..how can i achieve this??
Rgrds
kanna
|
|
|
|
|
If I understand you correctly, you have 3 "windows" in your application, 1 of which is a container. The container should then open 1 of the other windows in the stackpanel. If this is the case, the best way to do this is to make the other 2 windows UserControl s instead. These can then be hosted in your stackpanel, 1 with its Visibilty set to Visible and 1 set to Collapsed - this means you'll only see 1 item in the stackpanel at a time. Then, use a trigger to change the Visibility of the items based on the menu click.
|
|
|
|
|
Hi,
During uploading Progress indication is while reading the file ( with STreamWithProgress )
not while writing into the file. So the progress bar shows uploading is finished. But the file is still getting created. Please anybody help me understand this.
thanks
Rajani
|
|
|
|
|
Uploading to what? You need to provide far more information before we can help. Is this a WPF issue?
|
|
|
|
|
Sorry for not providing enough info.
I have WCF web service to upload files. Windows application calls upload file method on the web service. I have used the sample given in the below link
http://www.codeproject.com/KB/WCF/WCF_FileTransfer_Progress.aspx
I have seen that while reading the file the progress events are sent .
Hence after progress bar value reaches max, writing to the output file starts. Please clarify.
Thanks
Rajani
|
|
|
|