|
Yes, I am using studio 2003. I think we will wait for the final release of studio 2005 before adding drag & drop to our menus.
Thanks for your help,
Bill
|
|
|
|
|
I wrote a program with a whole bunch of tabs and each tab has subtabs with a bunch of controls in them. I distributed the program inside my company and some users complained that the text is cutoff on some controls. I asked for a snapshot and what happens is that the text wraps around on some of the controls and since the users are not aware of the wrap around feature to them it looks like the text is cut-off on top and on bottom.
Any ideas on how I can fix this problem so my GUI looks the same on all computers?
|
|
|
|
|
Welcome to the world of compatability. Trying to get an application to look the same on all computers is near impossible unless everyone in the company has the same type of operating system. If you're using studio 2005 and C# then the tab control's headers should auto-size to the length of the text. In 2003 I think you have to set auto-size yourself, either that or there will be a property called WordWrap that you can set to false.
|
|
|
|
|
Thanks for the reply; however, my main problem is that the text in miscellaneous controls such as checkboxes and labels are getting wrapped around even though they look fine on some computers.
Reason I mentioned about the tabs and subtabs is that I have way to many controls to modify them one by one, so I am hoping there is some method to make the GUI look the same on all PCs.
Your input about the OS is very good, I will check to see if that is the reason. Hope that's it because eventually everyone should go to XP.
Thanks.
|
|
|
|
|
Make your app check the screen resolution and inform users if it's too low. Or, find out the lowest screen res your users have, and develop at that res.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian, I should be able to get feedback on the resolution of all the users who are having problem and hopefully I can see a pattern to solve the problem.
Regards,
Rudy.
|
|
|
|
|
hi,
the text in the rich textbox is underlined!
when i enter a key in the textbox i want to have FontStyle.Regular:
<br />
private void textBox_Receivers_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)<br />
{<br />
textBox_Receivers.SelectionStart = 0;<br />
textBox_Receivers.SelectionLength = textBox_Receivers.ToString().Length;<br />
textBox_Receivers.SelectionFont = new Font("Arial",8,FontStyle.Regular);<br />
}<br />
but when i enter only the one char (the one which i pressed) is in the textbox...why, the other text is cleared!? whats wrong?
cu
-- modified at 16:31 Tuesday 30th August, 2005
|
|
|
|
|
The text box is doing exactly what all text boxes do when all the text is selected and you insert a letter. It takes the selected text and replaces it whith the new letter. You really shouldn't be surprised by your results.
If you want to change the font and attach the new letter, then you need to clear your selected text before you leave the method.
|
|
|
|
|
|
SelectionLength = 0;
That's the first thing that came to my mind. There are also arguments in the 'e' parameter that you can use. Cancel pretends the keydown never happend, sometimes called Suppress.
|
|
|
|
|
<br />
private void textBox_Receivers_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)<br />
{<br />
textBox_Receivers.SelectionStart = 0;<br />
textBox_Receivers.SelectionLength = textBox_Receivers.Text.Length;<br />
textBox_Receivers.SelectionFont = new Font("Arial",8,FontStyle.Regular);<br />
textBox_Receivers.SelectionLength = 0; <br />
}<br />
doesn't work...hm
cu
|
|
|
|
|
richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength = richTextBox1.Text.Length;
richTextBox1.SelectionFont = new Font("Arial", 8, FontStyle.Bold);
richTextBox1.SelectionStart = richTextBox1.Text.Length;
richTextBox1.SelectionLength = 0;
This works fine when I do it.
|
|
|
|
|
hi, thx perfect, but i have a problem
if i select the whole text in the richtextbox and press clear or backspace then the whole text isn't cleared...hmmm!?
but i think i also can do that with Rtf, i mean that with underline...? how?
i saw:
<br />
textBox_Receivers.Rtf ...<br />
by the time i like c# *hehe*
cu
|
|
|
|
|
Rtf is just the same text but with the formatting codes included. You would never want to set the font on your Rtf. The codes will never be seen. If you're asking how to do underline, it's part of the FontStyle just like Regular and Bold.
|
|
|
|
|
if i select all the text in the richtextbox and if i press clear or backspace then all the text isn't cleared...hmmm!?
why?
cu
|
|
|
|
|
Come on, that one is pretty obvious don't you think?
|
|
|
|
|
I need to know how would i remotely call methods on another pc(program) when my database(sql) changes(update occurs).I need to notify my viewing program(GUI) of the changes allowing immediatly show the changes as the database changes. How would this be done in C#. Triggers? I am very new to C# links to some nice tuts would be helpful as well as any other suggestions on how i would tackle this. Thank you
|
|
|
|
|
There are plenty of ways I'm sure, but I've always had the best success with custom TCP protocols. Meaning, you would connect to the remote computer through a TCP Client on a dedicated port, and send your own message format to the remote computer. The remote computer should have a thread that is constantly listening on that port for new connections. When it receives your connection, it verifies that it came from you (your custom message format should have a username/password in it), and performs the necessary operation based on the message. This approach has yet to fail me.
|
|
|
|
|
that sound great, is there perhaps some links to samples explaining in more detail, as i said i am new to programming. thanx again
|
|
|
|
|
If you've never set up a TcpClient, studio 2005 makes it pretty easy. Same for the TcpListener on the remote computer.
//DataBase Computer
TcpClient m_connection = new TcpClient("15.3.6.33", 17534);
StreamWriter m_writer = m_connection.GetStream();
m_writer.WriteLine("(app)(username)mel(/username)(password)mel(/password)" +
"(command)REFRESH(/command)(/app)");
//Remote Computer
TcpListener m_listener = new TcpListener(17534);
TcpClient m_connection;
StreamReader m_reader;
String strCommandText;
m_listener.Start();
while(true)
{
if (m_listener.Pending())
{
m_connection = m_listener.AcceptTcpClient();
m_reader = m_connection.GetStream();
strCommandText = m_reader.ReadLine();
// Now parse your message to find out what you should do.
}
}
-- modified at 18:16 Tuesday 30th August, 2005
|
|
|
|
|
Hi there,
I'm writing a Client/Server program that relied on Tcp Communication.
the problems begin when one of the clients that already connected to the server decide to disconnect (shut down the program or because of an error).
the thing is that before he decide to disconnect his status is "Connected" (at the database)
and after that, when the client has disconnected, the socket keeps on being opened for at least 60sec because of that the client cannot reconnect to the server
(and because the server couldn't tell if the client has been disconnected or not so his status is still "Connected").
What can i do?
can i raise any event that will tell the server that one of the clients has disconnected himself?
pls, need help...
thanks...
|
|
|
|
|
I have still not seen any events that you can listen for when it comes to the socket class. What I do is to have a thread that is dedicated to doing nothing other than checking my array of socket connections. If it ever finds a connection that was closed from the remote end, it calls the necessary method. That's with C#.. I've done development in C++ with QTSockets, which do (God bless them) have events for socket disconnection.
|
|
|
|
|
Hi!
The TcpClient has timeout properties and a LingerState property that controls if and for how long the underlying socket is kept open.
Perhaps twiddling with these will help you closing the socket immediately.
Regards,
mav
|
|
|
|
|
I want to convert the CR & LN characters to and from their decimal values.
so I would have a text variable set to "\r" and/or "\n" and I would want to display these values to the user as "13" and/or "10". Allow the user to changes these to other decimal values and convert back to the text equivalent for searching in strings.
I have the convestion from decimal to character as follows, but what about the other way around ?
string Data = INI.GetINI("Settings","Seperator","/13/10");
string [] Seps = Data.Split('/');
string m_Sep=null;
foreach(string Sep in Seps)
{
if(Sep.Length==0)
continue;
m_Sep += (char)int.Parse(Sep);
}
|
|
|
|
|
Converting is easier than you think. Just use basic byte-char conversion:
char one = '\r';
byte val = (byte)one; //result is a 13
char two = (char)val; //result is '\r'
|
|
|
|