|
SteveUK wrote:
There must be some way of passing an object into a function and guaranteeing that the function does no change the object. This is a pretty basic and essential feature for writing robust code.
This is pretty much built into .NET. The following shows you:
Foo(object o)
{
o = null;
}
Main()
{
Object o = new Object();
Foo(o);
WriteLine(o);
}
<a TITLE="See my user info" href=http:
|
|
|
|
|
non-editable parameters is not supported by the CLS nor c#.
In order to simulate this, you can make a clone of the object you are passing in.
|
|
|
|
|
Command line parameters in C#? Possible? How?
|
|
|
|
|
Almost every C# program has a method that is called before anything else when the program starts up:
public static void Main(string[] args)
{
}
The "string[] args" parameter is an array of commandline parameters.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
That's great! I suspected something like that - I guess what knowed me of was the fact that app wizard generated code has "main" without any parameters.
|
|
|
|
|
Dear gurus,
How do you make text displayed in a MessageBox BOLD and COLORFUL?
Thanks a lot in advance
Khang Nguyen
|
|
|
|
|
Probably you need the windows API called MessageBoxEx
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
You can't do it with the plain old MessageBox class. If you want to have specially formatted text like that you're either going to have to make your own class or look around CP or the web for one that someone has already made.
- monrobot13
|
|
|
|
|
Thank you so much, gurus!
Khang Nguyen
|
|
|
|
|
Hi!
Can a windows form container control watch all input going to its components?
My use case:
I have a panel with a textbox inside. I need to know if the mouse was clicked inside that panel, even if it was clicked inside the textbox area.
Thanks!
|
|
|
|
|
I'm not sure if this is what you want, but you could simply setup the event handler for the textbox click to call the panels click event
- monrobot13
|
|
|
|
|
The thing is that inside that panel can be _anything_, varying at run-time. So I do not want to (or can’t) delegate to the child controls the detection and raise of the event.
|
|
|
|
|
I can't believe it. In the newest version of .NET, the tabcontrol still looks awefull, why don't they fix it at the MS House, it shouldn't be that much pane, or is it?
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
If you're looking for a nice TabControl (like the one in VS.NET) I'd suggest checking out the Magic Library at http://www.dotnetmagic.com[^]
- monrobot13
|
|
|
|
|
I know, but it seems so simple to fix
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
While MS seems to walk both sides of the fence sometimes, they aren't their to do the development for everyone. That's why they built VS in the first place - so people could develop stuff. Most of the controls MS provides are pretty low in functionality anyways - the TabControl is pretty nice for a freebie. And as you said - it's not a tough fix - so go do some development.
|
|
|
|
|
Maybe you can join our project, Universal GUI Library[^]. We are trying to create an improved control library for C++ and .NET.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Using the Media Player activex control with the latest version of directshow sdk I can't figure out how to play the file. Setting the filename is apparently done with the Url property. Also can't figure out how to seek...set the media player position.
|
|
|
|
|
|
OK but I'm trying to get away from programming directshow or using s/o else's wrapper. I'd prefer to use the MS Media Player control.
|
|
|
|
|
I know this is probably a trivial question, but would you change the volume level of the system? I haven't found any infomration on the net about it. If anyone can give me a hand I would appreciate it. I have tried using the BasicAudio filter from the Interop.QuartzLib but when I change the audio object.Volume and set it to an integer it crashes. Thanks in advance. fdsaf
Ripsi
|
|
|
|
|
I know this is probably a trivial question, but would you change the volume level of the system? I haven't found any infomration on the net about it. If anyone can give me a hand I would appreciate it. I have tried using the BasicAudio filter from the Interop.QuartzLib but when I change the audio object.Volume and set it to an integer it crashes. Thanks in advance.
Ripsi
|
|
|
|
|
Hi All,
I'm the first to admit that I'm not to good at the design aspect of programming. So first I was wondering if anyone had any good suggestions on books that I could read that would help out with this topic. All comments are appreciated.
Second, I have a design question. I'm currently writing a program that uses a tabcontrol and I'd like end user to be able to dynamically add/remove/insert tabs into the program, now the problem is I'm not sure of the best way to implement this. I did design one version that used a checked listbox (in an options form) to allow the user to add/remove/insert "items", when the user clicked ok I would check what "items" had a check and create the tabs for them. Where I ran into a problem was that even items without a check need to be kept in memory so that when the user opens the options again they are still there (and it they check them they should be created, and vice versa) the other problem is that each tab has to have some data associated with it. What I did in the first design was have an array that I threw back and forth between the two forms, but that proved to be a very poor design. I'm just wondering if anyone has any better design that I could try I would really love to hear it. Any ideas or simple things to try would be extremely appreciated.
Thanks All!
- monrobot13
|
|
|
|
|
When you ask for books on the design aspect of programming, do you mean the design of the program itself (architecture) or do you mean the interface design (aestetics) ?
If you mean the design of the program itself (architecture), then you probably need to get going in UML. Though...I can't say I know a good book on it. Design Patterns is another topic to get familiar with...a good book on Design Pattersn is this:
Design Patterns: Elements of Reusable Object-Oriented Software
by Gamma, Helm, Johnson, Vlissides
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
KingTermite wrote:
When you ask for books on the design aspect of programming, do you mean the design of the program itself (architecture) or do you mean the interface design (aestetics) ?
Whoops, I suppose I should have been clearer on that. I did mean architecture design and thanks for the book reccomendation.
|
|
|
|