|
Using the ListView.HitTest[^] method; you give it the coordinates where the user clicked, and it'll return which subitem the user clicked on.
Bastard Programmer from Hell
|
|
|
|
|
Thanks Eddy. I Get Clear. 
|
|
|
|
|
You're welcome 
|
|
|
|
|
Please clarify:
Are you speaking here of an end-user clicking on a Column Header (i.e., the text in the column label area at the top), or are you speaking of an end-user clicking on an item in a Column, and from the item selected/clicked deducing the Column Header text ?
best, Bill
"It is the mark of an educated mind to be able to entertain a thought without accepting it." Aristotle
|
|
|
|
|
Thank you Bill.
Yes. Iam looking for the selected item value & its header text...The user will click on the item only...
And hence I need to find that value and its header text..
I found the answer with HitTest as Eddy has posted.
Thanks
modified 19-Jan-12 1:54am.
|
|
|
|
|
Hello,
I have many c# projects. I want know to create a Team Foundation project. I can't understand what it mean the Team Foundation Server. is it my IP @??
I want u help
regards
|
|
|
|
|
A few points:
1. This has nothing to do with C#
2. Googling would reveal a plethora of hits
3. Please try to avoid text speak. It only serves to annoy people. There are so many amazing letters in the English language, like the letter y. It's a shame to ignore them.
|
|
|
|
|
ok i know
Thank YOU for YOUR big help
Have a nice day
|
|
|
|
|
It is a server based application suited for development teams. It is not a project as such. Once you have TFS installed you can use it for project management, source control, continuous integration and a whole lot more.
TFS overview
"You get that on the big jobs."
|
|
|
|
|
I tried to compile a default C# template grid and get the following error message:
"Tool makepri.exe cannot be found. Please install Windows Modern SDK."
I did installation of Windows 8 on my machine and installed Visual Studio 11 Dev Preview just so that you know my congiruations.
Do I have to do an additional install?
Thanks,
Alex.
Alex Petrov
Software Developer
|
|
|
|
|
This is not a C# question, and belongs in this forum[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I want to make a program, i which, when a user SAYS "Draw circle", a circle should be drawn on the form.... i am working with windows forms c#.
i am familiar with
DrawCircle() method to draw
and
speechrecognizer
rec.LoadGrammar(g);

|
|
|
|
|
Great, let us know when you finish.
No comment
|
|
|
|
|
Excellent. I hope you write an article on it. Here's a couple of questions for you.
1. How do you know how big the circle has to be?
2. How do you know where to place the circle?
You might want to flesh your spec out a bit.
|
|
|
|
|
Give him a break. There is only so much design that can fit on a cocktail napkin.
No comment
|
|
|
|
|
Don't repost the same question in multiple forums.
|
|
|
|
|
Maybe he's trying to figure out how many times he can be disappointed.
|
|
|
|
|
momo.pomo wrote: i am familiar with DrawCircle()
You know more than I do; I only know of DrawEllipse() .
|
|
|
|
|
|
Hello,
Is possible create float form as modal form in WeifenLuo.WinFormsUI.Docking and how I can do it?
I need it for moving modal float windows to right screen side as dockcontent.
Thanks
Peter
|
|
|
|
|
The best place to ask a question on a specific library is in the forums associated with the library. You might want to try posting your question here[^].
|
|
|
|
|
Hi
This is my first binding and it is not working.
It is set to TwoWay and it seems to update source data with the data from text box.
Ít doés not update the data from TextBox.
<Window.Resources>
<c:CMyData x:Key="mObj" pText="George"/>
</Window.Resources>
<DockPanel Name="dockPanel1">
<Border BorderBrush="Silver" BorderThickness="1" Name="border1" DockPanel.Dock="Top" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="50">
<Button Content="Button" Name="button1" Height="47" Click="button1_Click" />
</Border>
<Border BorderBrush="Silver" BorderThickness="1" Name="border2">
<TextBox>
<TextBox.Text>
<Binding Source="{StaticResource mObj}" Path="pText" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay" />
</TextBox.Text>
</TextBox>
</Border>
</DockPanel>
</Window>
public class CMyData : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private string text="";
public string pText
{
get { return text; }
set
{
text = value;
OnPropertyChanged("CHANGED");
}
}
protected void OnPropertyChanged(string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
}
}
public partial class MainWindow : Window
{
public CMyData mObj;
public MainWindow()
{
InitializeComponent();
mObj = new CMyData();
}
private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
{
}
private void button1_Click(object sender, RoutedEventArgs e)
{
mObj.pText = "Hello\r\nWorld";
}
}
|
|
|
|
|
OnPropertyChanged("CHANGED");
... should be
OnPropertyChanged("pText");
Binding handles notification by updating the property which has been notified as changed. Or, if you want to update every property, you can notify on null.
Also, you shouldn't use name prefixes like that in .Net, particularly for public members. It should be class MyData, public string Text, etc.
And finally, the mObj you're creating in MainWindow and assigning the Text property of is not the same as the one in the resources. Instead of doing
mObj = new CMyData();
... you need to assign the local mObj (which can and should be private) out of the page resources, which I can't remember how to do off the top of my head. Hopefully a XAML/WPF expert will wander by shortly.
|
|
|
|
|
ok, I have changed the set property but I don't understand the second part.
I should not use this mObj object directly in XAML?
public string pText
{
get { return text; }
set
{
text = value;
OnPropertyChanged("pText");
}
}
mObj is declared in Window.Resources
<Window.Resources>
<c:CMyData x:Key="mObj" pText="George"/>
</Window.Resources>
I have changed the Xaml stil it is not working
<Window x:Class="binding5.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:binding5"
Title="MainWindow" Height="350" Width="525">
<DockPanel Name="dockPanel1">
<DockPanel.Resources>
<local:CMyData x:Key="mObj" pText="George"/>
</DockPanel.Resources>
<Border BorderBrush="Silver" BorderThickness="1" Name="border1" DockPanel.Dock="Top" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="50">
<Button Content="Button" Name="button1" Height="47" Click="button1_Click" />
</Border>
<Border BorderBrush="Silver" BorderThickness="1" Name="border2">
<TextBox>
<TextBox.Text>
<Binding Source="{StaticResource mObj}" Path="pText" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay" />
</TextBox.Text>
</TextBox>
</Border>
</DockPanel>
</Window>
modified 17-Jan-12 5:59am.
|
|
|
|
|
mObj is declared in the XAML, so in code, you need to retrieve the instance that's in the resources, instead of creating a new one. As I say I can't remember what the expression is exactly. It's something like mObj = Page.Resources["mObj"] but I know it isn't that simple. Someone who works with this stuff on a regular basis should come around here in a little while.
|
|
|
|