|
It didn't work perfect, but i tried to use:
this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - (this.Height + 30));
And that works perfect.
But! If i make the processbar bigger, it follows, but if i make it smaller, it is the same place as before, do you understand?
|
|
|
|
|
Try this:
this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
|
|
|
|
|
Doesn't work when i'm doing this:
this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
this.Width = Screen.PrimaryScreen.Bounds.Width;
this.Height = 22;
Have i made a mistake?
|
|
|
|
|
Since the code I gave you uses the Height of the object, you need to set the height before executing that line.
--
this.Height = 22; //this done first
this.Width = Screen.PrimaryScreen.Bounds.Width; //moved here to keep height and width in the same code locations
this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
|
|
|
|
|
Works perfect! Thank you very much!
|
|
|
|
|
Very good idea with the WorkingArea.
Never heard of it before!
Got my 5 for that!
All the best,
Martin
|
|
|
|
|
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
|
|
|
|