|
This is way more complex to do than for example writing a subject on a forum post. As you clearly do not have the faintest idea about how to write such a subject line, I recommend you simply give up learning to program for now.
Once you have mastered writign a subject, feel free to start posting again.
|
|
|
|
|
Hello,
I have a treeview control in one form, and another empty form with a panel on it. On the first form with the treeview, I can select multiple nodes. But now I want to drag'ndrop the selected nodes.
I use this:
// FIRST FORM WITH TREEVIEW
<br />
void boom_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
if (e.Button != MouseButtons.Left) return;<br />
<br />
foreach (TreeNode n in boom.SelectedNodes)<br />
{<br />
boom.DoDragDrop(n, DragDropEffects.Move);<br />
}<br />
}<br />
So the selected Items are made dragdrop. But now I want to display the text (or something related to the node) on the second form. But when I do that, only the first node is dropped, not the rest?
// SECOND FORM
<br />
void Template_DragDrop(object sender, DragEventArgs e)<br />
{<br />
if (!e.Data.GetDataPresent(typeof(TreeNode))) return; <br />
TreeNode node = (TreeNode)e.Data.GetData(typeof(TreeNode));<br />
MessageBox.Show(node.Text);<br />
}<br />
How can I show the multiple nodes?
Thank you at advance
|
|
|
|
|
Someone knows an answer?
Thank you
|
|
|
|
|
In the DoDragDrop call, you need to send all your data at once. I recomend adding the selected nodes (or their tags) to a list first, then send that list with a single call to DoDragDrop.
IList<TreeNode> items = new List<TreeNode>(boom.SelectedNodes);
DragDropEffects result = boom.DoDragDrop(items, DragDropEffects.Move);
if (result == DragDropEffects.Move) {
...
}
Jeff
|
|
|
|
|
i want to send a file ( pic1.jpg ) by e-mail! but without any openDilogFile for choosing file!
i know the path of file!
just C# coding for attach and send it !
any one can help me?
Imposible is Imposible...
|
|
|
|
|
Funny[^] how the first few google hits always include an article on this site.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
this is my answer!?!?!?!
Imposible is Imposible...
|
|
|
|
|
Amin Diary wrote: this is my answer!?!?!?!
Yup. We don't do your work for you. We'll help you with specific problems, but we're not here to do your job. Tell you what - give us your pay and we'll write the code for you. Seems fair.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
People who are obsessed with the rating system on this site will answer a question like this. I care more about helping people who want to learn, and the best way I can do that, is to show you how trivially you could have got far more detailed help than you'll get from a forum response, by typing some obvious keywords into google.
That I'm not trying to co-erce a 5 vote out of you doesn't mean I'm not the one who has your best interests at heart.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: That I'm not trying to co-erce a 5 vote out of you doesn't mean I'm not the one who has your best interests at heart.
Good answer. It coerced my 5.;)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
*grin*
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
//but without any openDilogFile for choosing file
like this below ,using javascript ,not C#,
html:
<a href="#" onclick="javascript:oEdit.Upload();void(0)">附件</a> |<br />
<input type="file" id="oFile" onchange="javascript:oEdit.OnFileLoad();void(0)" class="hidden" />
js:
function Upload(){<br />
var oEdit = eval(this.ObjUpload);<br />
oEdit.click();<br />
}<br />
function OnFileLoad()<br />
{<br />
var oFile = eval(this.ObjUpload);
var oFileName = oFile.value.substring(oFile.value.lastIndexOf(".")+1,oFile.value.length);<br />
if( oFileName.toLowerCase() != "txt" &&<br />
oFileName.toLowerCase() != "text" &&
oFileName.toLowerCase() != "rar" &&<br />
oFileName.toLowerCase() != "zip" &&
oFileName.toLowerCase() != "bmp" &&<br />
oFileName.toLowerCase() != "jpg" &&
oFileName.toLowerCase() != "jpeg" &&<br />
oFileName.toLowerCase() != "gif" &&<br />
oFileName.toLowerCase() != "png" )<br />
{<br />
this.ObjUploadFile.innerHTML = "<img src=\"Images/oFile.gif\" alt=\"附件\" /> 不允许上传的文件类型![ " + oFileName + " ]";<br />
return ;<br />
}<br />
this.ObjUploadFile.innerHTML = "<img src=\"Images/oFile.gif\" alt=\"附件\" /> " + oFile.value;<br />
}
|
|
|
|
|
Hi,
can anyone explain with example(if can) what is a wrapper class? From my basic understanding, u can use it in order to enable reusability and also if in case in the future, there is a better class, u can just replace it with the new one. However, i'm not quite sure how it works.
Thanks for any reply.
|
|
|
|
|
Wrapper class is an avtivity of migrating non OO types in languages in OO types i.e. in case of C# from basic value types (excepting structs, enums) to class types.
If this is somewhat difficult to consume consider following example.
Say you have one 'int' value which you want to wrap. So you would write a class like:
public class Integer<br />
{<br />
private int var;<br />
<br />
public Integer(int v)<br />
{<br />
this.var = v;<br />
}<br />
<br />
public get(){...}<br />
public set(){...}<br />
}
So now you have wrapped a simple integer into a class Integer which will be an OO type. Fortunately they are directly available in C# libraries.
Now a millon dollar question. What is use of this??
See, when you are going to deal with something which requires complete OO types e.g. object serialization, remoting you need this concept. As the complete manifest information is required in order to perform the activity.
That is it.
Chaitanya Joshi
|
|
|
|
|
No, a wrapper class is typically a class that exists solely to import and expose functionality that is otherwise not available. For example, my article on using the Canon SDK in C# is a wrapper class, the class exposes methods which call the methods in the Canon SDK dlls, via p/invoke. My classes are a wrapper, I do not offer Canon camera connection, simply a way to call a C++ SDK from C#.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I try to explain you my view,
A wrapper class enables reusability because you add an "interface" beetween implementation code and the use of it. If it's well designed, you can change implementation and its impact on use is minimal. If not, you will have to do a lot of changes in use code.
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
y should somebody declare the function or variable as static.what's the advantage
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
|
If you have a static function or variable you do not need to create an object to have access to that function/variable
class X
{
public string nonStatic = "hh";
public static string staticVariable = "xx";
public void NonStaticFunction()
{
..
}
public static void StaticFunction()
{
...
}
}
To have access to nonStatic variable and NonStaticFunction you have to write something like this
X obj = new X();
obj.nonStatic;
obj.NonStaticFunction();
To access the static variable and function you have to write code like this
X.staticVariable;
X.StaticFunction;
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
|
Hi All,
I wan't to compare two SQL Server databases. i.e., I wan't to check both databases structure and add if necessary.
In my project I am using SQL Express database and now we update some fields in the database. So, if we wan't to update the new versions for those customers who are using old database we need to update the database also. It is not recommanded that to manually add the fields in the database and is time taking too. So, I wan't to compare two databases(old and new) and update the fields in the old database.
Any confusion in my question plz let me know so that I can be more clear.
Thanks for any reply,
Narayana Ayyagari.
|
|
|
|
|
There are several commercial packages that does this very well, no free ones I know of. In SQL2005 you can try what is suggested here: http://blogs.geekdojo.net/richard/archive/2007/06/04/134600.aspx[^]
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
hi ,
this may sound very stupid but i want some body to explain to me what is the difference between
public static void Main()
{
}
AND
public void Main()
{
}
what is the purpose of using void in the main function ie anyway a main function doesnot have to return any values right
expecting a reply at the earliest
j
|
|
|
|
|
Trustapple wrote:
expecting a reply at the earliest
Read this [^] article.
Trustapple wrote: what is the purpose of using void in the main function ie anyway a main function doesnot have to return any values
You use void to let the compiler know that the function doesn't return any values.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Hi..
Trustapple wrote: public static void Main()
public: It means that this method can be accessed from anywhere....
static: without creating the object of this class we can call the methos directly by using its class name...
void: As this main method is a function it should return something so we specifying void which means that it will not return any value...
main: it is a function name where the program starts executing...you can call this function from any other functions tooo like....
public void callMain()
{
main();
}
Regards,
Sandeep Kumar.V
|
|
|
|