|
We can do this with the help of delegates.
Regards,
Arun Kumar.A
|
|
|
|
|
Try this:
<code>
class lib
{
public delegate void myDel();
public myDel objDel;
public void Execute()
{
if (objDel != null)
objDel();
}
}
From the Window Application:
lib objLib = new lib();
objLib.objDel = new lib.myDel(sample);
objLib.Execute();
</code>
<pre>
<div class="ForumSig">Regards,
Arun Kumar.A</div>
|
|
|
|
|
That's me ..
public partial class Form1 : Form
{
RegistryKey key;
public Form1()
{
InitializeComponent();
key = Registry.CurrentUser.OpenSubKey(@"HKEY_CURRENT_USER\Software\NanoSoft\Preferences",true);
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
key.SetValue("Assistant", "1", RegistryValueKind.String);
}
else
key.SetValue("Assistant", "0", RegistryValueKind.String);
Nothing happens
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: key = Registry.CurrentUser.OpenSubKey(@"HKEY_CURRENT_USER\Software\NanoSoft\Preferences",true);
Thats current_user twice.
|
|
|
|
|
As the subject says, I screwed up
Thanks Luc, I've been blind to see it for the previous half an hour
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Sorry, I wanted to vote 5 but accidentally I hit 4!
Thanks Luc!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi! Can anyone tell me how to set the Visual Studion 2005 to display all the windows auto-generated code like in Visual Studio 2003? In 2003 I can see all the codes of what has been created for me, and I can modify it to whatever I want. But in 2005 I can't see those codes. If anyone has done it before, please give me a hand. Thank you in advance for your time.
Best regard,
Jack
From Hell With Love
|
|
|
|
|
In VS2005, the auto generated code is in a seperate file, due to the existence of partial classes. It's called yourfile.designer.cs.
You can't change it back.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
That's very sad... After all I'll have to reinstall my VS 2003. Thanks for your help Mr. Graus.
Best regards,
Jack Toke
From Hell With Love
|
|
|
|
|
What on earth for ? Why is having the IDE hide it's autogenerated code in another file ( which you can open and read all you like ) a problem ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Why is having the IDE hide it's autogenerated code in another file ( which you can open and read all you like ) a problem ?
And for that he wants to move back from .NET 2.0 to 1.1?
Cheers,
Vıkram.
Déjà moo - The feeling that you've seen this bull before.
Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
hi,
in 2003, if you add a form to your project it will create two files: Form1.cs (in C#) and Form1.resx. and all you design time and other codes will be in the Form1.cs file.
but in 2005, it will create 3 files: Form1.cs, Form1.Designer.cs and Form1.resx. Form1.cs contains the code that you type such as event handlers and other functions, and Form1.Designer1.cs contains the auto generated design time code.
so, if you want to modify the design time code, open the Form1.Designer.cs file and make the changes.
hope this helps
ragards
|
|
|
|
|
Oh! You have been a great help. I never know this before. Thanks alot.
I begin to like this codeproject now. I can get help in a matter of minutes. Very cool.
All the best,
Jack Toke
From Hell With Love
|
|
|
|
|
OK - cool. I did tell you where the file was. Editing them by hand is generally a bad idea, but you can still do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
jackptoke wrote: I can get help in a matter of minutes. Very cool.
Don't count it every time. We all have lives too, you know.
|
|
|
|
|
Dear All,
I need to add some text on an image( may be in bmp or jpg format). I have to do it using C#.
Can anyone help me? Plz give me some hint.
Enamul Hoque
|
|
|
|
|
There are several articles about it at codeproject. Search and you will find them
|
|
|
|
|
I have tried with the search string,
"adding text over an image"
and with many more combinations.
But each time codeproject shows, Sorry No Results Found.
Plz help me. What should be the search string.
I am badly in need of it
|
|
|
|
|
using (Bitmap bm = Bitmap.FromFile("c:my.jpg"))
{
using(Graphics gr = Graphics.FromImage(bm))
{
gr.DrawString(......
}
}
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian. I have solved my problem with your help.
Thanks very much.
|
|
|
|
|
Now Let me state my original problem.
Actually i need to overlay text on a .avi file.
I have planned it like this:
First i will extract the frames from the avi file, then overlay text on each frame and then reconstruct the avi file with these frames.
Is my approach efficient????
Can anyone suggest a more efficient solution?
Please Help me.
|
|
|
|
|
Christian, Please help me.
i need to implement a solution immediately in C#.
Is there a way to overlay text on an avi file directly?
Enamul Hoque
|
|
|
|
|
Hello, I am writing a class and in this class I want write a method that get some information . this information must fill by 3 textboxes in loginform for connecting to database.but I do not know what should I do?
this is the code in my class:
using System;
using System.Collections.Generic;
using System.Text;
namespace DuryHouse
{
class Genral_Class
{
public string conection_string;
//Define Method for connect to Database
public Conect_DataBase(string servername,
string userid ,
string pasword );
{
???????? I do not know what I should write ?????
}
and what codes I should write in login form after preesing OK button for connect to database.
my database is SQLserver2000
}
|
|
|
|
|
Have you tried google ? You're basically asking how to connect to SQL Server from C#, right ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It looks like you are writing a DAL. The name "Genral_Class" [sic] would therefore be inappropriate. If you were planning on putting in lots of stuff in there then you might as well not use an OO language because you clearly aren't taking advantage of it.
You have not told us what you want the connect database method to do. Do we guess? My guess is that it could be any one of the following
* Generate the connection string and store it in the field.
* Generate the connection object
* Generate the connection object and open the connection (thus making the connection)
* Something else
|
|
|
|