|
hellow to all ..
i am trying to creat a public variable in my forum that i could access it from othere forms ..
but it is not working for me ..
how can i creat it ...
thxx
|
|
|
|
|
The simplest solution is to create a class with a static field in your Forms namespace.
<br />
class MyClass<br />
{<br />
public static int publicVariable = 0;<br />
}<br />
You access the variable above by: MyClass.publicVariable = 10;
|
|
|
|
|
Don't use public variables, use public properties.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i want the code to enable one button out of three when other two are are disable and vice versa in c#.net
ursbuddy
|
|
|
|
|
That's pretty straightforward. What have you tried ? To tie the three buttons together, you'd need to create a control. It's easier just to write code that enables one button and disables the other two.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
you must think about how this will logically work then......
Toggle between the button.enabled property.
if you want the button disabled you say button1.enabled = false;
if you want the button enabled you say button1.enabled = true;
That should u going dude.
|
|
|
|
|
hi
i am using vc# 2005 and sql 2005 express.
my problem is does exist any way to set password on sql2005 database ?
(because i don't want to end users access to sql server's tables and datas and ...)
how to solve my problem ?
thanks
|
|
|
|
|
I think you need to download SQL Server express 2005 management studio, this programme gives you control over the security functions of the database.
You will have to connect to your MDF file using this.
You should then be able to create a fairly strong username and password.
you can do these changes using sql commands but i would use the management studio.
Then when you first create a new datasource in C# express edition do not use windows authentication to connect to the database use your new admin username and password.
Hope this helps
|
|
|
|
|
It should be as regedit.exe. How to deduce data from the register?
|
|
|
|
|
YOu want to write a console app to edit the registry ? Why ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
For that what more close to get acquainted with a writing of programs for management of windows
|
|
|
|
|
The namespace Microsoft.Win32 holds several classes that deal with the registry, you just have to read the class library documentation.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello there.
I have a project to build a form with a tool box . This tool box contains Controls such as Button , Textbox , Label ... etc .
The main project is to let the user to build his own form in runtime and save it to xml file which is easy but i want to know how to add and drag the controls on the form .
Thank you in advance
Asaad
|
|
|
|
|
Basically, you want to write code which tracks the mouse position, and draws the controls based on where you move the mouse. You want to handle all your mouse events, down, move and up. Then you need to keep track of the items you've drawn, and where they are. If you build it with actual controls, then you can use their click events to help you ( in a derived class, I'd think )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you .
Can you give an example
|
|
|
|
|
Anything more complex than the example someone gave below would be non-trivial for me to crank out. You should start with that, and ask more questions as you get stuck.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi!
It's really easy.
The MouseMove event should be enough. Check if left mouse button is pressed, then change the Top, Left properties according to mouse positon
if(e.Button == MouseButtons.Left)
{
Point p = PointToClient(Form1.MousePosition);
if (Math.Abs(button1.Top - p.Y) > 5
|| Math.Abs(button1.Left - p.X) > 5)
{
if (p.X > 0
&& p.Y > 0)
{
button1.Top = p.Y;
button1.Left = p.X;
}
}
}
|
|
|
|
|
Thank you very much .. I'll try that.
|
|
|
|
|
Wap to find grade of a student using if else& switch in c
Arun.S.P.
|
|
|
|
|
we don't solve home works.... idiot
then this is c# board not c.... idiot
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
if (ArunCopiedHomework())<br />
{<br />
return 'F';<br />
}<br />
else<br />
{<br />
return 'A';<br />
}
(Hint: look at above and think about what you can compare in an if statement.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
How ironic the subject of this thread is, as you don't deserve any grade at all.
---
b { font-weight: normal; }
|
|
|
|
|
Don't post homework problems here
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
if(youreAskingBasicHomeWorkQuestions)
{
YouDidntPayAttentionInClass = true;
}
if( YouDidntPayAttentionInClass )
{
Grade="F";
}
|
|
|
|
|
Wap to reverse a number in c
Arun.S.P.
|
|
|
|