|
|
in oirder to do that you can use recourses file or the bettre way is to create an engine to translate any label in the page from a database
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
I've been working with my own custom events for controls and thought I had it figured out until I wanted to implement "Before" events(you know like BeforeExpand in TreeView).
This kind of event will have a "Cancel" or "Handled" flag to indicate to the sender that the event was canceled (or handled) by the subscriber to the event.
My question is, as the sender of the event, how do I know about the Canceling or handling?
I understand that the eventargs object will have a boolean value to indicate this but how does that information get back to the sender?
Thanks in advance,
Eric
|
|
|
|
|
|
Beringer wrote:
but how does that information get back to the sender
Because the event args are sent as a reference, so when control returns to your event handler the boolean value will be retained.
assuming the following FooEventArgs have a "CancelFoo" boolean property
private BeforeFooDelegate beforeFoo
private void onBeforeFoo(FooEventArgs e)
{
if(beforeFoo != null)
beforeFoo(this,e);
if(!e.CancelFoo)
this.Foo();
}
|
|
|
|
|
|
Cancel
Supported by the .NET Compact Framework.
Gets or sets a value indicating whether the event should be canceled.
// Calls this method from the InitializeComponent() method of your form
private void OtherInitialize() {
this.Closing += new CancelEventHandler(this.Form1_Cancel);
this.myDataIsSaved = new Boolean();
this.myDataIsSaved = true;
}
protected void Form1_Cancel (Object sender, CancelEventArgs e) {
if (!myDataIsSaved) {
e.Cancel = true;
MessageBox.Show("You must save first.");
}
else {
e.Cancel = false;
MessageBox.Show("Goodbye.");
}
}
mahes
|
|
|
|
|
|
hi there can someone help me out here... please tell me how to connect oracle as back end in C# & VB.net . i know how to connect MS Access and SQL server, but couldnt figure out this one.
failure can only inspire me...
|
|
|
|
|
|
|
Hi everyone
Is there a quicker and more efficient way of importing data programmatically from a table in database A into a table in database B using a C# windows application?
At the moment I open the connection to database A and read the data form the table into a dataReader object. Then I open the connection to database B, loop through the datareader and insert the data into the table in database B.
Thanks.
Kobus
|
|
|
|
|
Hi ,
Guess you can use DataSet Merge and Data Adapter's update functions to do this.
Thanks and Regards
Pani.
|
|
|
|
|
I have some questions on creating objects and classes.
1) When a member in the base class (class A) is declared as private (say "private int x"), will the instance of the derived class (class B) has a that private member? Is that an inherited class always inherits all members of the base class but cannot access the private members? (For example, in this case, class B also has "private int x", but cannot access "x" )?
2) When a method in the base class (class A) is overridden by the derived class (class B), is that the overridden version of the method be always called?
For example,
class A
{
public virtual void Test()
{
Console.WriteLine("This is A");
}
}
class B : A
{
public virtual void Test()
{
Console.WriteLine("This is B");
}
}
static void Main()
{
B b = new B(); A a = b;
b.Test();
a.Test();
}
The above code sample is copied from a book, but I am confused.....
I know the statement "b.Test()" will cause the output "This is B"
but how about "a.Test()", as a is referenced to the object of type B, which version of the method will be called?
What is meant by "A a = b"?
Again, thanks a lot for your help!!
Regards,
Tommy
|
|
|
|
|
tttyip wrote:
When a member in the base class (class A) is declared as private (say "private int x"), will the instance of the derived class (class B) has a that private member?
No, that's what private is for. Protected is visible in derived classes.
tttyip wrote:
What is meant by "A a = b"?
B is an object of type B. By definition, it is also an object of type A ( because B is derived from A ). You can create an instance of a base class, and create it using an instance of a derived class, that's one way that polymorphism can be powerful, you can have an object and know broadly what it is, but let it change at runtime which specific type it is. The method in class B will be called, again, that's what makes it powerful. If you had another class, C, that derived from A, you could create an instance of B or C, and use a variable of type A to hold either. Which method is called depends on if it is a B or C, but because the method is common to A, you can define both, and then change which is called by changing the object.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm currently in the very early planing phase of a small program that I want to create.
I have a limited knowledge about c# but I want to learn more.
My goal:
1. I want to create a database that'll be readable only with my program (or encrypted mdb or something).
Basically I need to ensure security of the database so people won't be able to read it unless they use my program.
2. I want the database to hold like a table that contain the following info:
id: 1, 2, 3....
name: john, mickel, smith
address: street name+house, street name+house, street name+house
address2: neighborhood, neighborhood, neighborhood
address3: city, city, city
number: 6 digits, 6 digits, 6 digits
remarks: up to 5 lines, up to 5 lines, up to 5 lines
remakrs2: up to 3 lines, up to 3 lines, up to 3 lines
3. The user will see a table similar to the right side of the picture in this guide:
http://www.codeproject.com/cs/database/DatabaseAcessWithAdoNet1.asp
titles at the top and each line will be 1 entry contains all the data (id, name, address, address2, address3, number, remark, remark2)
4. The user will have an edit button that will allow him to edit the line entry that he selected (only 1 entry is allowed).
5. I'll need to store this database on a remote location with a server program running and a client program at the user location (so I need server and client versions).
6. The server program will be able to modify the database as well as adding users that will be granted access to the database.
7. The users that use the client program will need to enter a valid username\pass to enter the database.
Basically I want to know the best way to acomplish what I want and what I need to learn and google in order to acomplish that.
I'll apretiate any and all help I can get on this subject.
ThanX in advanced
daat99
|
|
|
|
|
I'm creating a plugin for Internet Explorer that, amongst other things, will scan images looking for certain elements. In order to do so, I'll need to have access to the actual images loaded in the currently open web page.
Through the DOM tree I can access all the image tags in the page, but I don't know how to access the actual images. Right now I'm working around the problem by downloading the images separately, but that solution won't work forever.
One great solution might be a way to access the cached image on the user's hard drive. Is there a mechanism to do so?
Thanks,
Chris
|
|
|
|
|
Help!
I still have made no progress in figuring out how to do this...
Thanks,
Chris
|
|
|
|
|
I'm creating a security plugin which, amongst other things, checks whether or not certain pages are secured with the proper SSL certificates.
As part of the plugin, I'd like to be able to get information from Internet Explorer about the SSL security of the currently loaded page.
Ideally I'd like to be able to discover the "fingerprint" of the SSL certificate of the currently loaded page. I'd also be happy with simply knowing whether or not the certificate is validated by the certificate authority.
Thanks,
Chris
|
|
|
|
|
Help!
I still have made no progress in figuring out how to do this...
Thanks,
Chris
|
|
|
|
|
The last time I downloaded the beta version of C# it was beta 2.
The opening screen always says "Cannot find server " . Just like I was offline.
Beta 1 , never did that.
Am I alone here ? or is this what everyone is getting from Microsoft ?
I'd like it to function correctly, even the toolbox shows nothing in it.
I tried a complete erase and re-download twice, I get the same results every time.
Is this a bug, in the download ?
By now that should have been resolved, if that was a problem.
Ron U:
Happy Trails .
|
|
|
|
|
|
I have used a mschart component in my form,
but I have no idea how to use the my customised image to replace the background color of bars.
Thanks
|
|
|
|
|
I made a chat program that displays the text in a listbox. When I created a thread to handle the received data, I found out (using the debugger) that a lot of controls of the form were inaccesible from the thread! However, all was OK with the main thread.
Whats wrong?
Thanks
|
|
|
|
|
You cannot directly access controls from a thread different than the one that created the controls. Look up the help on Control.Invoke for more info on how to interact with the UI thread from other threads
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|