|
You can use BeforeLabelEdit event
private void ListView1_BeforeLabelEdit(object sender,
System.Windows.Forms.LabelEditEventArgs e)
{
if (e.Item == 7)
{
e.CancelEdit = true;
}
}
|
|
|
|
|
Hello all!
I am using a C# program and would like to create database (SQL Server 2000) from the source code. Can anyone provide some help.
Thanks All,
Tran Dung
|
|
|
|
|
The thing to type into google is ADO.NET, you'll find a ton of examples. If you mean you want to create a database from scratch, just write a script to create a database, and execute it in C#, using ADO.NET.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
tadung wrote: I am using a C# program and would like to create database (SQL Server 2000) from the source code.
You can execute any SQL Script through SqlCommand not just the regular SELECT, INSERT, UPDATE & DELETE.
Here is an example of Running SQL scripts with a .NET application[^]
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hi all,
My program is just a small .EXE file since i'm not using any special dll's.
1. does the user must install FRAMEWORK on his computer even though i use
just a few dll's?
2. if i use FRAMEWORK 1.xx is it ok for him to install version 2.xx ?
3. is it posible to make an installation package that will contain the
FRAMEWORK package because i dont want to send the users to microsoft
website , its not nice.
Thanks alot,
Ran.
R.Z
|
|
|
|
|
1. Yes, they need the framework.
2. It depends. You should test on 2.0 and make sure that your app is written to not be strongly associated with an older version. You can make an app require a version, or it can find the closest version. Also, if you're distributing a framework anyhow, why not make it the one you're using ?
3. Yes, I think you can download merge modules for installers. I personally write an installer app in C++ that runs the framework install and runs my MSI as well. It's possible to install the framework silently, though.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
is it posible to install few versions on the same computer?
i mean , if i will give the user the old version and he allready have a newer version will it install and use the old version along the already-installed newer version?
Ran.
R.Z
|
|
|
|
|
Yes, no problem.
Different framework versions can co-exist on the same computer peacefully.
Regards,
mav
|
|
|
|
|
sorry again,
Is there a built-in tool as part of the VISUAL STUDIO that will allow me to include the Framework as part of my installation.
i dont think i can build up something of my own..
Thanks again,
Ran.
R.Z
|
|
|
|
|
How do i set the start position of the childform that i open from my main form?
I dont' want it to be in the center of the parent form or FormStartPosition.CenterParent.
i want it to be set at 218,28 of the parent form
|
|
|
|
|
You need to set it manually, which means you need to set it AFTER you show the form. Otherwise, the framework moves it on you. So, you need to get the position of the parent form top and left, and add 218,28 to it
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Right,got that, but how do i refrence that to the parent form?
would it help if i better explain?
i've got my parent form set to load at the same point based on where you closed it. the problem i'm having is trying to refrence the location of 218,28 of the parent form, since the form isn't allways going to be located at 0,0, it maybe located on screen two or three of a multi-screen system, and the user has to move across to system.drawing.point(218,28) just to reach the new form... not sure, maybe i'm just missing your point...no punn intended
pretty much i've tried everthing i can think of(yes, very limited) and the most i've found to even come close was this.PointToClient. this was nice, it moved the new form in relation to the parent form, but the problem is it often disappears based on the parent form...basically it didn't work correctly ever.
|
|
|
|
|
The parent form has a Left property and a Top property. At least, I think it does I'd take those, and add the values to that. And, if you set the owner of the child form to be the parent, the code can go in the child form, it can move itself when it is first shown, and check it's owners position as a starting point.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Actually, that was one of the things that i didn't think of at the time of writing that last post, i actually had just testing that before you replied... having some difficulty as i having to make sure everything is in its proper place...oh syntax.....
i'll post my results in a few...hopefully!
|
|
|
|
|
hey, yah, as simple as it was, that was the solution.... why is it easier to think of the hard(or complicated) solutions before thinking of the simple ones?
must just be me....
|
|
|
|
|
Hi all.
I would like to have few files in my code, like WAV file and ICO file and i
also want to use them in the program but i dont want to have them as an extra
files inside my directory (because then things can go wrong..)
how can "attach" them in DLL or in the EXE itself ?
thanks,
Ran.
R.Z
|
|
|
|
|
You'll have to embed these as resources.
You can find out more here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Wow
so quick.
i will check it out.
R.Z
|
|
|
|
|
Hi all,
Can someone please point me in the direction of how I would go about being able to set certain items in a ComboBox to Bold.
Basically I want my Combo to look like this when i drop it down
Group1 <bold>
A
B
C
Group 2 <bold>
D
E
F
Cheers
Jubjub
"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders
|
|
|
|
|
The only way you're going to be able to do that is if you ownerdraw the item list. The ComboBox doesn't support doing this on its own.
You can find an example of ownerdrawing a ComboBox here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thank you for that link. It was perfect. I am now trying to figure out how to get the default font a Combobox would use, so I can reuse that, and just change the setting to Bold for certain items.
Cheers
Jubjub
"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)
|
|
|
|
|
you might also want to look at this control.
http://www.codeproject.com/cs/miscctrl/ImageComboBoxControl.asp
|
|
|
|
|
That's a pretty good one too. How did I miss that?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
What will be the diff if I use casting of int and Convert.Int32().
|
|
|
|
|
You can only cast to an int if the datatype is similar, like a long or a double. You also use that syntax to unbox an int, for an example if you store then in an ArrayList.
Converting to an int can be done from more data types, one common example is a string.
You can also use int.Parse() to convert from a string. That is similar to Convert.ToInt32. One difference, though, is that Convert.ToInt32 will accept an empty string and return a zero value, while int.Parse won't.
---
b { font-weight: normal; }
|
|
|
|