|
Good People,
How do I get a form I have added to my project to show? I want it to show in response to a user's button click.
Also, how do I design a form that looks like, for example, the "Exception Assistant" dialog? It doesn't have that heavy blue border/header at the top. Is there some criteria or selection that should be checked or must I code it?
Thank you,
BP
|
|
|
|
|
BlitzPackage wrote: How do I get a form I have added to my project to show?
Create an instance of the class and call ShowDialog()
BlitzPackage wrote: I want it to show in response to a user's button click.
Then you need a click event. Double click on the button in the designer and you'll get one.
BlitzPackage wrote: It doesn't have that heavy blue border/header at the top.
Change that property in the form designer. I forget it's name, although I always change it ( the default is resizable form and I never want that ) The default also puts an item in the taskbar, I never want that, either. The default is stupid.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian,
You'll never believe the error tht kept me from showing the form - I did not create an instance of the class and was trying to call show on the type - LOL!
At any rate, I'm still searching for the feature that will remove the blue border at the top.
Thanks again,
BP
|
|
|
|
|
You can remove the blue border at the top by selecting None for FormBorderStyle in the visual designer. If you don't like the way that looks, there are several other choices.
|
|
|
|
|
Thanks,
One last quick question: Can I create a customer interface using Visual Studio (C#) 2005? In other words, supposed I wanted my application to have a mac style look and feel or other different skin theme, can I use what ships with Visual Studio to do that?
Thanks again,
BP
|
|
|
|
|
Kind of. ToolStrips, MenuStrips, ContextMenuStrips all have a Renderer property, that controls the look and feel.
I recommend the free Krypton Toolkit[^], makes your forms, buttons, menus, everything look beautiful.
|
|
|
|
|
|
Result is here:
I ask I find
http://msdn2.microsoft.com/en-us/library/aa446560.aspx
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
namespace OutputTest
{
class Program
{
public static int i;
static void Main(string[] args)
{
while (true)
{
i = Console.Read();
Console.WriteLine("Output: ", i);
}
}
}
}
|
|
|
|
|
Umm...you have no break set in your control loop. That program's gonna hang at the while and never release. Not sure why it would print 3 times. What are your command line args?
|
|
|
|
|
It should run forever: while(true)
|
|
|
|
|
ok...so, take this "super-hypothetical never would happen in real life situation" where a provider of an external web service requires an authentication token to invoke any of the methods contained in their provided services. ...And say again in this "super-hypothetical never would happen in real life situation" that they didn't provide a dev account to your project group, so each time you want to test your code against the service, you have to use the release account and are eating up these precious tokens that your company is paying out the wazoo for....as such, the project controller doesn't want to pay for another account to use as a dev account, but at the same time doesn't want to eat up tokens before the thing ever goes live(which means -no unit testing at all...basically develop it black-box and then hope when you flip the switch nothing screws up...not gonna happen)
...With me here? Now, take again in this "super-hypothetical never would happen in real life situation" where the provider of this external service has live demos with input textboxes on a web form interface that provide full functionality of the service. Is there any way in this "super-hypothetical never would happen in real life situation" that a wrapper around this demo could be created so that a program could send it's data through the pre-defined web interface and consume the data that is returned?
...And just to clarify, the app that I'm talking about to wrap around the web service client is not desired for production(would probably get in big trouble for that). I'm just needing some way of testing my logic and there's currently no way of doing so but since the provider has a permanently authenticated thread on the server, I thought it would be nice to create a demo that could demonstrate functionality by funneling through their pre-existing client.
|
|
|
|
|
Try using a webbrowser control in your app. Through it you'll have acces to the html document loaded and you'll also be able to interact programatically with the controls or even the script functions within the page. I did something some time ago.
|
|
|
|
|
Good People,
What do the following words mean in C#?
Partial
Refactoring
Delegates
Thanks,
BP
|
|
|
|
|
They mean [^]
only two letters away from being an asset
|
|
|
|
|
1 - Not a whole
2 - When your factor fails, you have to refactor.
3 - When you have to take off a legate, you use Delegates.
|
|
|
|
|
I'm not sure why you're asking this, if not for homework ?
Refactoring means the same in any language. Partial means you're using VS2005, it's a new keyword. A delegate is a fancy function pointer.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
LOL - it's not for homework. (After 12 years of college/grad school primarily in the 90s, those days are long gone.) I am learning C# here at work and want to use it for my first software project. I'm self-taught.
Thanks for your answers,
BP
|
|
|
|
|
BlitzPackage wrote: I am learning C# here at work and want to use it for my first software project.
OK - google would have answered them all, but...
a partial class has more than one .cs file, you just put 'partial' in your class definition, and the compiler will find all files relating to a class and merge them
Refactoring means to take existing code and change it's structure, most commonly by breaking a large function into several smaller ones.
A delegate is a function pointer, like I said. That means, a variable represents a function which can be assigned and called in code. All the event handlers in your forms code, like when you click a button, is handled with delegates.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
|
Thanks Ed,
I appreciate your answers.
Sincerely,
BP
|
|
|
|
|
hi
1. Partial - its a new kyeword introduced in c#2.0 and is use to write a class in distributed form
E.G - look at the designer of your form it is Form1.designer and where u write code is partial class form1. similarly u can have no. of class u want with the same name like partial Form1 and write and these will be combined in a single class i.e Form1.. Realy a good feature..like Sometime when no.of developers need to work on same class and so others.
2. Refactoring - provided to help u need writting templetes in code. For C# there is inbuilt Refactoring in dot net and for VB.net need to install third party. one can provide own code snipette and use refactoring to use them Simple best way to make lazy programmer.
3. Delegate - this is a something that works between event source and event target. It handles the event.
Atul kumar
|
|
|
|
|
I have to open Excel workbooks with different excel versions. With the reference for Excel2000 (Version 9.0) the code is
Excel.Application oEA = new Excel.Application();
oEA.Workbooks.Open ( "testfile.xls", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing , Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing );
This version needs 13 arguments for the Open-Method.
With a reference for Excel 2003 (Version 11.0) the same method needs 15 arguments.
My software has to run with both Excel-versions. If I compile with reference to Excel2003, my software does not run with Excel 2000 and vice versa.
Does anyone have an idea?
Ali Nehring
|
|
|
|
|
Create a class that wraps the object creation based on object type (2000, 2003, etc.). Then call you wrapper's Open, which just calls the correct version.
|
|
|
|