|
Well, you know where the info is, in the framework. Don't they have google where you live ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
With replies like that you can see why they made him an MVP :P
|
|
|
|
|
|
Hi there...
I am getting crazy with these ugly buttons from visual studio 2003... When i make my programs in C/C++ (allegro), GTK+ for linux and others i have a good support to choose the button style i want to use.
I just wanna know if can i change the style buttons on Visual Studio 2003, C#.
ahhh, not only buttons, radio, check, combo, all things...
thank you guys...
Lucas
|
|
|
|
|
You'll need to design or use someone elses custom controls. The VS03 controls are primarily the stock win32 ones that've been around since NT3.5. IIRC Vista offers a full set of newer shinier ones but you'll need C#3.0 for that.
|
|
|
|
|
dan neely wrote: IIRC Vista offers a full set of newer shinier ones but you'll need C#3.0 for that.
Hm? Isn't it framework 3.0 that is needed, i.e. the format WinFX? C# 3.0 doesn't add anything visual, does it?
---
b { font-weight: normal; }
|
|
|
|
|
you're right. Blame MS's lame naming system for winFX.net for the confusion.
|
|
|
|
|
The project i am currently working on is receiving data through a TCPClient from a server. The server is sending messages to the clients. I have this part working.
When the server sends an initalization message, the client form received this message on a seperate thread. I then use Invoke to pass this message to the thread of the client form.
<br />
public delegate void InvokeData(DataMessageClass d);<br />
<br />
private void Client_DataReceived(object sender, DataMessageEventArgs e)<br />
{<br />
this.Invoke(new InvokeData(this.Data), new object[] { e.DataMessage });<br />
}<br />
<br />
private void Data(DataMessageClass dataMessage)<br />
{<br />
switch(dataMessage.MessageType)<br />
{<br />
case INIT:<br />
{<br />
break;<br />
}<br />
}<br />
What i would like to do is open the child form using ShowDialog ( to prevent the user from hiding it and interacting with the parent until its close ), but receive the additional messages on this child form instead of the parent form. When the message is a COMPLETE message, the child form will close and the parent will again listen for the INIT message to start the process over again.
I know that ShowDialog is blocking as it will block all additional messages comming in from the server until the child form is closed.
I have tried to assign the event on the child form however the messages are not received on the child until the for is close.
I have been able to make this work with the parent reveiving all the message and then passing them on to the child form. In order to make it work this way, i have had to use Show() which allows the user to hide the form behind the parent form.
I am at a loss as to what to try next.
|
|
|
|
|
You don't need to use ShowDialog(). Create the child form with something like this:
ChildForm child = new ChildForm();
child.owner = this;
child.Show();
From the help files:
When a form is owned by another form, it is minimized and closed with the owner form. For example, if Form2 is owned by form Form1, if Form1 is closed or minimized, Form2 is also closed or minimized. Owned forms are also never displayed behind their owner form.
Hope that helps.
Cliff.
|
|
|
|
|
Cliff,
I had stumbled on to this solution just as you replyed. Thanks, this as somewhat the effect i am after.
However, this still allows interaction to the parent form while the child form is visible and does not have focus (ie. i can access menu items). Is there anyway to prevent the user from access items on the parent form?
With ShowDialog(), if you were to try and bring the parent form into focus, the parent never get focus and the user can not interact with it. I suspect that this may be because ShowDialog() is blocking the parent form. Is there a way to duplicate this behavior with Show()?
Jason
|
|
|
|
|
Handle the event of focus of your parent form and then check if the child form is still alive. If so then cancel the current event and focus child else call base function for default focus behaviour.
Regards
Khalid
|
|
|
|
|
Jason V wrote: However, this still allows interaction to the parent form while the child form is visible and does not have focus (ie. i can access menu items). Is there anyway to prevent the user from access items on the parent form?
I suppose you could disable the parent form.
Alternatively, you could receive the data in a separate thread that passes it on via a delegate. When you create the child form, you change the delegate to the child, setting it back in Form.Closed.
Cliff.
|
|
|
|
|
Hi,
I upgraded my C# Windows form application project to Visual Studio 2005 and now my Deployment project no longer works correctly. From the administrator account I can install my windows application w/ no errors and I can run the program from the desktop shortcut w/ no errors. However, when one of the normal users logs on and trys to start my application by double-clicking the desktop shortcut, the following error occurs:
An installation package for the product AMCAT cannot be found. Try the installation again using a valid copy of the installation package "SetupAndInstallAMCAT.msi".
Note: AMCAT is the name of my Windows application.
Any help would be greatly appreciated!
Thanks,
Terri
|
|
|
|
|
I am a begginer in C# programming. I am trying to run a simple program made on C# but unable to see the output using messagebox control. i run the code and on form load, it should display a message "Sucessful". Everytime I run the program, it displays an error message "Form1.cs(82): The type or namespace name 'textbox1' could not be found (are you missing a using directive or an assembly reference?)".
Please help me in interstanding the error message and debugging it.
Thanks in advance.
Regards,
Mini
|
|
|
|
|
That error is telling you that you're trying to use Textbox incorrectly. Have you consulted the MSDN yet? (http://www.msdn.com) ...Whenever you run into a problem like that, the first place you're going to want to look is the MSDN. ...Now to answer your question, look up at your "using" statements at the top of your .cs file . If "using System.Windows.Forms" is not there, then you need to add it. (That's what it meant when it said
Form1.cs(82): The type or namespace name 'textbox1' could not be found (are you missing a using directive or an assembly reference?)
if that doesn't work, then you might want to consult the MSDN and look up "Textbox" with a C# language filter. It will bring up all the information that you would need to learn how Textboxes are used in C#
|
|
|
|
|
Very Very Thanks for your help Alaric.
|
|
|
|
|
You can get help for the errors directly in VS. Just select the error in the error list and press F1.
In your case I guess you've simply made a typo: Is the TextBox object you want to access really called "textbox1"? C# is case sensitive, so textbox1 is different from textBox1 ...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I didn't mention VS because he made no mention of using VS. He could be writing it in Notepad
|
|
|
|
|
i want to create a project.In form, add a url and get content of the page from that url
|
|
|
|
|
hoatien wrote: i want to create a project.In form, add a url and get content of the page from that url
I want to have cheeseburger and fries for lunch. Nice talking to you.
You might want to read the post at the "TOP" of the forum: How to get an answer to your question
|
|
|
|
|
Use WebBrowser control.
Regards
Khalid
|
|
|
|
|
Hello -
I am working with a datagrid in a Windows application that has a bool column with checkboxes. For certain rows, I want to add functionality to make the checkbox disappear depending on the value of another column.
First things first, i cannot make a selective cell invisible for the life of me. Can someone point me in the right direction? I have seen some posts about this for ASP.NET but nothing for windows forms.
Thanks,
Eric
|
|
|
|
|
there is no such direct function or property to disable or to make a cell invisible.you have to handle this task programmatically.chek your condition on grid click event or at valuechange event
sameer
|
|
|
|
|
Thanks for the reply Sameer.
I know there is not direct function or property and that this would have to be handled programmatically...however, I am even having problems doing this through any event or Paint/Edit override. If you have an example of how to do it, please forward on.
|
|
|
|
|
Hi,
I've developed a .net 2.0 application and am now testing it on different computers. This usually works fine, but on some of the newest computers (core 2 duo laptops from Dell) the program just seems to randomly pop-up an error message saying that my "application has encountered an error and needs to be closed". It doesn't say what kind of error was encountered, and when I drag away the window I can continue to use my program just fine. Any suggestions?
Thanks in advance!
|
|
|
|