|
Good, I think I'll be into WPF or WTF;P soon.. No seriously, I'm interested, it sounds quite sexy
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
As it turned out the solution was moderatly simple.
I had to do the following in the drop eventhandler:
Task t = (Task)e.Data.GetData(typeof(Task));
_currentMousePosition = MouseUtilities.GetMousePosition(taskTree);
HitTestResult result = VisualTreeHelper.HitTest(taskTree, _currentMousePosition);
if (result.VisualHit is FrameworkElement)
{
_targetTask = (result.VisualHit as
FrameworkElement).DataContext as Task;
}
After that it's just removing the task from the original parent and add it to the new parent. Pretty easy
Too bad the mouse handling in WPF sucks, because I had to rely on Josh Smith's MouseUtilities class to get the actual mouse position relative to the treeview. Maybe I will build a dragdropmanager for the treeview similar to the one Josh created. It makes life a lot easier.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
|
|
|
|
|
hi, am developing windows application, I put datagridview on one of its windows forms, i want to know the way of adding hyperlinks column that will enable be to move to another windows form when i click on it
Thanks alot
Hamody
|
|
|
|
|
Don't cross post the Same question in different foru.
I have seen CG has answered you in Asp.Net.
Regards,
Satips.
|
|
|
|
|
no no i need a code sample cause i searched and didnt get anything, he didnt give me a sample, so please f u know, give me a sample
Thanks alot
Hamody
|
|
|
|
|
Try this article
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi, I want to drag and drop items from a listview to windows explorer, is there a way of knowing the path of the directory where the items has been dropped?
Thanks in advance.;)
|
|
|
|
|
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string file in files)
{
try
{
if (!listBox1.Items.Contains(file))
listBox1.Items.Add(file);
listBox1.SelectedIndex = listBox1.Items.Count - 1;
}
catch (Exception ex)
{
MessageBox.Show("Cannot find "+file, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanks for your answer, but what I want to know is the path of the windows explorer directory where the items were dropped.
|
|
|
|
|
I'm writing a program that is a shortcut in the windows sendto directory. When the user sends too many files the program won't even load so I can't even warn the user of the problem. I think it's based on the size of the full path of each file. Does anyone know a way around this? Thanks a million.
|
|
|
|
|
hi , please how i can add paramters to report by C#
i'm using this classes
CrystalDecisions.CrystalReports.Engine.ReportDocument _Rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
string _path= Application.StartupPath + @"\CrystalReport1.rpt";
this.Text =_path;
_Rpt.Load(_path);
here i want add filter to this report ???????
123
|
|
|
|
|
You know.. collapse button on the row header on which you click to view the child table.. I'm going nuts but just cant get it
Please HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELP!!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Ok, I did it..
<pre><code>
oraCONNECTION = new OracleConnection(@"Data Source=orcl;Persist Security Info=True;User ID=DLDSP;Password=DLDSP;Unicode=True");
oraADAPTER = new OracleDataAdapter();
DSet.Clear();
oraADAPTER.SelectCommand = new OracleCommand("SELECT * FROM INS_STRUCT", oraCONNECTION);
oraADAPTER.Fill(DSet, "INS_STRUCT");
oraADAPTER.SelectCommand = new OracleCommand("SELECT * FROM VILS", oraCONNECTION);
oraADAPTER.Fill(DSet, "VILS");
DataColumn PK = DSet.Tables["INS_STRUCT"].Columns["ID"];
DataColumn FK = DSet.Tables["VILS"].Columns["UZLA_ID"];
DataRelation Rel = new DataRelation("VILS",PK, FK);
Rel.Nested = true;
DSet.Relations.Add(Rel);
dataGrid1.DataSource = DSet.Tables[0];
FormatGrid(dataGrid1); //Not listed here.
</code></pre>
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Anyone who knows howto rewrite this event in C#?
|
|
|
|
|
Private Sub oGsmModem_NewMessageReceived(ByVal e As ATSMS.NewMessageReceivedEventArgs) Handles oGsmModem.NewMessageReceived
txtMsg.Text = "Message from " & e.MSISDN & ". Message - " & e.TextMessage & ControlChars.CrLf
End Sub
private void oGsmModem NewMessageReceived(ATSMS.NewMessageReceivedEventArgs e)
{
Handles oGsmModem.NewMessageReceived;
txtMsg.Text = "Message from " + e.MSISDN + ". Message - " + e.TextMessage + ControlChars.CrLf;
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Handles doesn´t work in C#. An event handler have to be set up, but I don´t know exactly how?
|
|
|
|
|
Hi
your project sounds so interesting. could you please send me your project when you done it.
my email is : exhesham@gmail.com , Thank u
|
|
|
|
|
Maybe, if someone can help me with this little question
What I´m trying to do is building an SMS Gateway: Receive an SMS from a mobile phone via serial port then decode it and store it in a database. Finally show the message on a webpage, perhaps in a guestbook or in a community. The event handler checking constantly for new messages on the phone. This now works with VB.NET but I rather wants it in C#. But, as the question is, I still can´t get the event to work
|
|
|
|
|
I have been reading through articles to get some insight into my configuration needs for an application, and have came up empty handed. I was hoping someone knew of something that might suit my needs. Basically, what I want to do is find the executing assembly directory, and see if a certain config file is in the folder. If not I want to create it, so I can imput settings into it when the time comes. Does anyone know where I can find an article that will help me along?
|
|
|
|
|
To get the path of your assembly use
Assembly.GetExecutingAssembly().FullName
|
|
|
|
|
I have tried that, that only returns the full name of my assembly, not the directory that it resides in.
|
|
|
|
|
Sorry ! My misstake .
try
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
|
|
|
|
|
System.AppDomain.CurrentDomain.BaseDirectory will return the directory for where I would want to create my file. Just found it in an article here =)
|
|
|
|
|
Thank you very much for the help. It turns out that the namespace that I found:
System.AppDomain.CurrentDomain.BaseDirectory
And the namespace that you found:
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
Both return the path that I am looking for. Is there one of these examples that would be better for what I am trying to accomplish? Or are they both the same, just with 2 ways of getting the same result?
|
|
|
|