|
1.)
for (int i = 0; i < 24; ) Console.Write(i++ % 6 == 5 ? "\r\n" : "o");
2.)
for (int i = 0; i <9 ; i++) Console.WriteLine(new String('0', ++i));
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi,
I am trying to integrate MS Word in my application as a control, can I? Actually I want to use the drawing tools and equation editor tool of MS Word in my application.
How can I do this?
Pls help me.
Thanx
|
|
|
|
|
Hi,
I recommend you another way - to integrate your app into Word, e.g. build your app over a documet-level VSTO solution or in application-level Word add-in. Unfortunately, Word as a COM object doesn't provide its tools separately (the drawing tool in your case).
|
|
|
|
|
is there any way or properties that set closed all nodes of an XML file?
thank you
|
|
|
|
|
What do you mean? In what way do you want to "close" the nodes?
Are you talking about something that is displaying an xml file?
---
single minded; short sighted; long gone;
|
|
|
|
|
yes, when an xml file displaying
|
|
|
|
|
Alt-F4?
Alt+Ctrl+Delete?
It all depends on which viewer you are using...
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
i don't want to close viewer
i need all nodes are closed when an xml file open for display
when you open an xml file, it is like as below
-[root]
-[child]
[msg]text1[/msg]
-[child]
[msg]text1[/msg]
-[child]
[msg]text1[/msg]
[/root]
and what i need is below
-[root]
+[child]
+[child]
+[child]
[/root]
|
|
|
|
|
I was being sarcastic. Perhaps if you told us the viewer we could help. Also, what has this to do with C#?
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
i guess there was any properties in xmldocument or other xml classes that close all nodes (maybe you called them Tag) of an xml file when it open by IE or other xml viewers
|
|
|
|
|
It's not a function of the document, it's a function of the viewer; for instance a TreeView has a CollapseAll() method.
|
|
|
|
|
at last i fund that it did by xslt file
|
|
|
|
|
Hey all,
I'm having trouble with the Asynchronous UDPClient.BeginReceive() method. I've finally gotten the (extremely poor) example in the MSDN docs working, however as soon as it receives any data the application quits, when ideally I'd want it to continue listening to the port.
To get around this, I simply call the method containing the call to BeginListen() again from the callback, but I'm having serious doubts about this as a preferred method of doing things, given that this method (and from MSDN) simply blocks in a while loop:
while (!messageReceived)
{
Thread.Sleep(100);
}
and without this "Do some work" business the application just quits again. Now this could actually be quite useful, as the reason I'm looking at this BeginReceieve stuff is so that I can terminate the listener as and when I want to, which seems a lot more tricky when using blocking port access.
So after all that rambling, is this the way it should be done, or have I hacked myself into a tight spot?
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
The example is not quite up to the normal standard for examples in MSDN (with the one letter variable names for one), but it's still adequate to show how the method is to be used.
Examples in MSDN is not on the "for dummies" level, they are just short examples to show the code in some kind of context. If you need more than that, you should buy a book about it.
martin_hughes wrote: To get around this, I simply call the method containing the call to BeginListen() again from the callback
Yes, that's what you normally would do. Alternatively, you could call the method from your main program after processing the data.
martin_hughes wrote: but I'm having serious doubts about this as a preferred method of doing things, given that this method (and from MSDN) simply blocks in a while loop
As the comment in the code says, it's just an example. Normally your program would just continue with what it's normally doing, usually just go back to the message pump and wait for something to happen.
---
single minded; short sighted; long gone;
|
|
|
|
|
Well, I still think the example is poor - and definitely not up to scratch. But thanks for the advice anyway
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Been trying find a way to update a form ( same instance) directly from a class.My example below compiles but the form result leaves the textbox blank.
using the Form1 myform = new Form1 thing works but again leaves the form blank.
Can anyone help? I'm new to this so go easy on me.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace test1
{
public partial class Form1 : Form
{
public string strStringVarible;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
classtest1 clstest = new classtest1();
clstest.external_class();
}
public void accessor_method()
{
this.textBox1.Text = strStringVarible;
this.textBox1.Refresh();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
________________________________________________________
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms.Design;
using System.Data;
namespace test1
{
class classtest1 : Form1
{
public void external_class()
{
this.strStringVarible = "test123";
this.accessor_method();
}
}
}
I'm new so go easy on me please
|
|
|
|
|
Hello,
What you did is:
You have a Form named "Form1" (which derives from System.Windows.Forms.Form).
Than you have a Form named "classtest" (which derives from your Form1).
Hardboiled86 wrote: private void button1_Click(object sender, EventArgs e)
{
classtest1 clstest = new classtest1();
clstest.external_class();
}
At the button Click, you instanciate a new Form (classtest1), which means that now two Forms are in memory (one that you see, and the new second one).
You call the method "external_class" from your second Form, which calls "accessor_method" also from your second Form.
So it should be clear that your first Form, which is visible will not change.
Look at this excellent Article from Colin Angus Mackay[^]
Hope it helps!
All the best,
Martin
|
|
|
|
|
NEVER put such code in forum,only put the code wich u feel having a problem.No one has time to see this kind of stupid stuffs.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Hi
I have to convert the
AVI frames to JPG or BMP
format. Kindly send the C# code
for the same.
Thanking you
Sridharan
|
|
|
|
|
when we want open a file,we have to double click on the file,but Right now,i want open it by command,What must I do?,(note: open file which can see inside of it)
|
|
|
|
|
File.GetAllText ? Hard to know, your question isn't really laid out in a way that makes much sense.
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 )
|
|
|
|
|
Use StreamReader object to read the content of the file and display it in a window. Also, please make sure that your file may not only contain text data but it can contain picture etc. Hence, if you want to see the real world inside the file you should reading it in binary format and display the records.
Manoj
Never Gives up
|
|
|
|
|
thanks you,I am sorry because I don't display obvious my ideal
After that,I will display my question
when we double click a file,the window of file will display,and we can see the tittle of it(EX: file.txt)
If we use command of C#,what will we do to see the window of file.txt opended ?
|
|
|
|
|
just use Process class.Inside it there one method which takes input as file name and opens it.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|