|
Override the methods with a method that throws an (informative) exception. That way the coder have to override also.
---
b { font-weight: normal; }
|
|
|
|
|
How would you do that? When don't have a "middle" class where we can do the overriding.
Each of our control classes derive directly from a webcontrol - I think adding a class between the webcontrol and our class would be the same as doing most of the work ourselves
|
|
|
|
|
Then you can't do it. You cannot change the behaviour of a class using interfaces, you can only specify behaviour to be added. To change the behaviour of a class you need to inherit it.
---
b { font-weight: normal; }
|
|
|
|
|
We don't want to change the behaviour - we just want to make sure that some protected methods are overriden in the classes that inehrit from the base class.
Thanks for your help.
|
|
|
|
|
You just can't do that without changing the behaviour. If the base class doesn't enfoce that the methods are overridden, you can't enforce that without changing the methods.
---
b { font-weight: normal; }
|
|
|
|
|
Dear All,
Does anyone know how can I zoom and image in and out..and make it initially when displayed fit the area specified for it without having to use scroll bars?
Thanks and Best Regards,
E.A.
|
|
|
|
|
Hello
Using DrawImage method of Graphics class you can specify any size for your image. And it will be drawn using that size.
With best regards,
Andrew
|
|
|
|
|
Got problem as follows:
In the main form I have 100 PictureBoxes which names are digit00...digit99.
I need to change their images often that`s why I would like to group them into some structure, an array for example. Then write a function that would cover this automatically, for example:
<br />
void MyFunction(int which)<br />
{<br />
MyArray[which].Image = Image.FromFile("aaa.aaa");<br />
}<br />
How to do this, especially how todefine and set the array?
tnx a lot in advance
|
|
|
|
|
Hi,
I think one option could be to use an ArrayList (something like a dynamic array) or another one to use a hashtable, where you use the name of the picturebox as key and the picturebox itself as value.
What are you looking for exactly ?
Regards
Sebastian
|
|
|
|
|
Hey,
Firstly I'm using VS 2005 Beta2.
I'm using databinding to a combobox which is populated with user defined objects (of the same type), and the databinding is on the it's SelectedItem property.
<br />
Binding bOnX = new Binding("SelectedItem", myDataSource, "objX");<br />
<br />
bOnX.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;<br />
<br />
comboBox.DataBindings.Add(bOnX);<br />
Now I know by default the databinding is onValidation hence I've changed it to OnPropertyChanged. However, it still does not bind to the data source when I changed the selected item, only when I move focus to another control. With that said, I'm also using the same DataSourceUpdateMode for a text box with a databinding on it's Text property and that works every time the text changes in the TextBox.
I think (please correct me if I'm wrong) that the OnPropertyChanged on works on the the property being bound to, for eg.:
for,
Binding bOnX = new Binding("Text", myDataSource, "strX");
DataSourceUpdateMode.OnPropertyChanged, works on the TextChanged event
but because there is no SelectedItemChanged event it does not work on the former example.
Can anyone please let me know if I'm right or wrong, and either way, please suggest a solution.
chukkykzn
chukkykzn@msn.com
|
|
|
|
|
Hi,
I'm looking for a way to change the default height of the propertygrid description pane.
The only property we have from the Propertygrid object is HelpVisible, but not any which could set its height.
I looked inside the object, and the PropertyGridInternal.DocComment object is the description pane object, but it is private and its impossible to access to its properties (like Height...).
I also tried to derive the propertygrid object and access to its child controls, but it does not change anything :
class MyPropertyGrid : System.Windows.Forms.PropertyGrid
{
public MyPropertyGrid
{
}
public void ChangeHeight()
{
foreach(Control ctl in this.Controls)
{
if(ctl.Text == "Description Pane")
ctl.Height = 100;
}
}
}
It might possible, because the PropertyGrid of the object properties in Visual Studio does remember the height of the description pane (try to change it, close VS, reopen it and see!).
Thanks in advance,
Touffic
|
|
|
|
|
hi,
Our marketing team wants to release a product that should run only run on the computer of the user for an X amount of days, after that it should just show some messagebox. Kind of like a time trial version.
Now my question is, how can I make this as tamper proof as possible, since people can still put their windows clock 1 year back, and keep working with the program.
Any hints and/or tips where I should look at?
thanks,
Gidon
|
|
|
|
|
Hi...
just a small suggestion... maybe you can build your application to do a date check upon every execution... as long as there is a difference between this captured date and the saved date... increase your counter by the difference (x) ... take it as the application has been running for x numbers of days... then save this new date... thus even if i were to set the date back 1 week... the program will acknowledge this as the program being used for 1 week...
thus when the counter reaches, say 30... the trial period will end... make sure to encrypt the counter value...
there is a way to tamper though... that would be for the user to set the date to the same as the first launch date everytime before starting the program... or they found a way to tamper with your counter value...
just a suggestion...
|
|
|
|
|
Hello friends!
I'm in the process of conceptualizing a test program that (hopefully) shuts down my unit for a given time but the catch is I want the program to close all running applications first particularly my internet connection (since i'm using dial-up connection) and shuts down my unit properly. Is this do-able in c# and if so could someone please give me a boost on this.
I'm fairly new to programming let alone c# and i'm trying to scroll through the namespaces and i can't seem to get a solution for my problem. So any assistance regarding this matter would mean gold to me. Thanx for all your helps!
Oh yeah I'm using Windows XP home ed and VS.NET 2003. Almost forgot..
Kampai!!!
|
|
|
|
|
you can try using kill() to kill the processes
you can try searching msdn for "C# kill process"
|
|
|
|
|
Hey thanx!
I found a similar program that shuts down a machine for a give time but the problem is it forces applications to terminate meaning it doesn't close applications properly. Any lead on this? How can i access my tool bar using c#? Thanx!
Kampai!!!
|
|
|
|
|
maybe you can use
myProcess.CloseMainWindow();
but this only works with application with user interface. It behaves the same as selectign close from the application interface. There will be a user prompt for any unsaved data.
but for applications without user interface, you will need to use
myProcess.Kill()
hope this helps
|
|
|
|
|
Indeed!
Thanx for the assistace it was such a big help! I gues i've no choice but to force terminate every application and hopefully doesn't ruin my machine . Thanx again frend!
Kampai!!!
|
|
|
|
|
my idea is to save the files in a tempory folder other than the existing folder when the system is shut down.
how to do it.
|
|
|
|
|
Directory.CreateDirectory[^]
File.Copy[^]
Insert following into your main form to detect system shut down.
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0011)
{
}
base.WndProc(ref m);
}
www.troschuetz.de
-- modified at 3:40 Tuesday 30th August, 2005
|
|
|
|
|
Whether we can able to save all the open files automatically before the system shutdown.Also there exist any APIs for saving filet in c sharp.net.
I am expecting your most valuable reply
|
|
|
|
|
What do you mean by "all the open files"? What types of files do you open where and how?
www.troschuetz.de
|
|
|
|
|
I'm looking for way to capture audio (from microphone) and video (from webcam) and stream across network.. but most of examples that i have found are for web page web cam apps and thats not what i'm looking for. I came across one app example to capture webcam images but can't 'refind' the link.. and microphone capture eludes me.. I've been working on various aspects of this project for days now and could have easly passed them over by sheer exhaustion (coding can be an obsession).. any tips or pointers on simple audio/video device capture using p/invoke would forever indebted... Thank you for your time in reading my plea for help
When this darn code gets finished.. look for my article
|
|
|
|
|
Try this article:
http://www.codeproject.com/cs/media/directxcapture.asp
It is about Audio-Video capture in DirectX, and it is awesome!
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is obliterating us.
|
|
|
|
|
How can I write superscript in label in winform. I need write l.s-1. How can I do this?
Thanks
My skills:
HTML - advance
PHP - advance
MySQL - advance
Perl and Embperl - beginner
C# - beginner
PostgreSQL - beginner
3D Studio - beginner
AutoCAD - profesional
Patrik Ružič
|
|
|
|