|
I couldn't respond to your email because you haven't confirmed your address.
I'm glad to see you got your answer.
|
|
|
|
|
how to enter the values in rows o a datgrid in deviceapplication.I am trying to enter values in rows but i m not able to edit anything within datagrid.
|
|
|
|
|
Check that the readonly property of the datagrid is set to false.
|
|
|
|
|
there is no such property as Readonly in deviceapplication
|
|
|
|
|
Hi!
If i make a TCP server and i try to connect, the firs time it succeed but then i get an error message: "No connection could be made because the target machine actually refuse it".
<br />
private void AddLine(TextBox tb, string text)<br />
{<br />
if (tb.InvokeRequired)<br />
{<br />
AddLineDel d = new AddLineDel(AddLine);<br />
this.Invoke(d, new object[] { tb, text });<br />
}<br />
else<br />
tb.Text += "\r\n" + text;<br />
}<br />
<br />
private void Listen_button_Click(object sender, EventArgs e)<br />
{<br />
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, port);<br />
<br />
sock.Bind(ipep);<br />
sock.Listen(2);<br />
sock.BeginAccept(new AsyncCallback(AcceptConn), sock);<br />
}<br />
<br />
private void AcceptConn(IAsyncResult iar)<br />
{<br />
Socket oldserver = (Socket)iar.AsyncState;<br />
client = oldserver.EndAccept(iar);<br />
AddLine(textBox1, "Connection from:" + client.RemoteEndPoint.ToString());<br />
Thread receiver = new Thread(new ThreadStart(ReceiveData));<br />
receiver.IsBackground = true;<br />
receiver.Start();<br />
}<br />
<br />
private void ReceiveData()<br />
{<br />
int recv;<br />
string datastr = "";<br />
while (true)<br />
{<br />
if (client.Connected)<br />
{<br />
cleardata();<br />
recv = client.Receive(data);<br />
datastr = Encoding.ASCII.GetString(data);<br />
if (datastr == "exit")<br />
break;<br />
AddLine(textBox1, datastr);<br />
}<br />
}<br />
client.Close();<br />
AddLine(textBox1, "Connection closed");<br />
return;<br />
}<br />
}<br />
If anyone knows how to make a TCP connection where the same client can connect and disconnect multiple times.
Please help me! Thanks.
Regards,
Marta Paniti
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
pmartike wrote: If anyone knows how to make a TCP connection where the same client can connect and disconnect multiple times.
Sure.
In your code above, you're only listening for the first connection. Your Listen_Button_Click() method calls BeginReceive() and passes it the delegate for AcceptConn() .
So far so good, but once that method is called your socket isn't listening anymore. You have to re-wire the callback by invoking BeginReceive() again to listen for more incoming connections.
Share and enjoy.
Sean
|
|
|
|
|
Thanks!
Problem solved
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
Hi,
do you have any idea how to find the Width of a document ?
thanks.
|
|
|
|
|
Define "document" in the current context.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
define the context of the current "document"
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
WhiteGirl23 wrote: do you have any idea how to find the Width of a document ?
Print it and use a ruler.
You haven't provided anywhere near enough information to allow us to help you. What type of document? What width - on screen/in print?
|
|
|
|
|
I use tx textcontrol to transform a word document in pdf.
but if my document is to big I can't see the all pdf,I can see only a part of it.
Because of this I use textcontrol function: LoadSaveAttribute where I need the width,Height,LeftMargin of the document.
Thanks for you help.
|
|
|
|
|
I would think that the forums for this control would be the best place to start. BTW - I found this[^] blog entry about licensing which addresses your earlier post.
|
|
|
|
|
You can use the office tools to control Word within your app, that may help. Otherwise, you are asking a lot of questions here about a control that, in all probability, most of us have not used. I don't want to discourage you from posting here in general, but these questions will probably get better answers if you ask them in forums for the product you're using.
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 )
|
|
|
|
|
in my application i have one table control in that i took 5 radiobutton,
my problem is no one select atleast one radio button then he won't go next page.how can validate these radiobuttons
srinivas
|
|
|
|
|
you can set a default one
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
if(!(rdioBtn1.Checked || rdioBtn2.Checked || rdioBtn3.Checked || rdioBtn4.Checked || rdioBtn5.Checked ))<br />
{<br />
MessageBox.Show("Please, select one.");<br />
}
Mohamed Gouda
Egypt
|
|
|
|
|
You can use Required field validator control...
Enjoy coding....
|
|
|
|
|
Hi Mohamed Gouda garu ,
THANKYOU VERYMUCH
your code is very useful to me
THANKYOU VERYMUCH
Regards,
srinivas
srinivas
|
|
|
|
|
I am studying c# myself. It's some piece of code from Herbert Schildt's book, it's working but I cannot understand displayRev part, like return gives what..
Can you explain the code line by line?
using System;
class RevStr
{
public void displayRev(string str)
{
if(str.Length>0){
displayRev(str.Substring(1, str.Length-1));}
else{
return;}
Console.Write(str[0]);
}
}
class RevStrDemo
{
public static void Main()
{
string s = "jale";
RevStr rosb = new RevStr();
Console.WriteLine(s);
rosb.displayRev(s);
}
}
Insistence
|
|
|
|
|
I won't do it line by line, but I will explain what recursion does and hopefully that will help you. Basically, recursion refers to a method calling itself until some condition is met - (if there is no condition to meet, this is referred to as infinite recursion and is generally seen as a bad thing).
The code above is stepping into the displayRef method repeatedly, and is subtracting a character from the string that it passes into itself on each recursion. The terminating condition is the string being empty. When the string is empty, it exits from the method (the return statement) and unwinds itself back up the stack.
As you can see, the unwind simply writes the first character of the substring to the console.
I hope that helps.
|
|
|
|
|
jalburzicon wrote: Can you explain the code line by line?
Please, first read [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
in the end of recursion,does it return "e" from if-statement,
with every recursion , does it writes str[0]?
these are my problems =(
I understand the logic, but I cant get into code, it is necessary to write by myself, thanks
Insistence
|
|
|
|
|
Just single step through the code in the debugger and watch what it is doing. Basically your recursive step occurs while the length of str is greater than zero. The base case is when the length of str is 0. From a quick glance, the recursive function doesn't look like as good of an example as something like the basic recursive factorial function, which is more clear about what is going on...
Essentially, the displayRev puts the original string onto the stack in forward order, but displays as reverse when popping off the stack...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Thanks about the debugger idea, I am not that practical on programming yet as you see..
Insistence
|
|
|
|