|
Hi,
I'm using Tab Control in my application, where the text fore color is black and backcolor is white. But I would like to have fore color as white and backcolor as black. If I change "DrawMode" property to OwnerDrawFixed, I'm able to change the style. But its not showing the changed styles in XP machine. Its working in Vista machine.
Please suggest me other way to have text color as white and backcolor as black.
Thanks in advance.
|
|
|
|
|
Hi,
ForeColor and BackColor are properties of TabPages, not of TabControl itself.
Try to reset the value of TabControl.DrawMode to Normal , and set the BackColor and ForeColor properties on the TabPages.
Regards.
|
|
|
|
|
Thanks for your reply. I reset the value of TabControl.DrawMode to Normal and set the BackColor and ForeColor properties on the TabPages.
<pre>const string DEFAULT_TAB_NAME = "Default";
tabCtrl1.TabPages.Add(DEFAULT_TAB_NAME, DEFAULT_TAB_NAME);
tabCtrl1.TabPages[DEFAULT_TAB_NAME].Controls.Add(dataGridView1);
tabCtrl1.TabPages[DEFAULT_TAB_NAME].ForeColor = Color.White;
tabCtrl1.TabPages[DEFAULT_TAB_NAME].BackColor = Color.Black;</pre>
But the tabname, "Default", characters are not appearing in white color and back color not in black color. Had I followed you?
|
|
|
|
|
Hi,
I would rather do this way :
const string DEFAULT_TAB_NAME = "Default";
TabPage tp = new TabPage(DEFAULT_TAB_NAME);
tp.BackColor = Color.Black;
tp.ForeColor = Color.White;
tp.Controls.Add(dataGridView1);
tabCtrl1.TabPages.Add(tp);
I tried to change ForeColor and BackColor properties, in the designer and also programmatically, and all's working like a charm. So I guess your problem isn't in the small piece of code you provided.
|
|
|
|
|
Sorry, may be my question is not clear. The above Tabpage Back and Fore colors are belongs to the text inside the tabpage. But I would like to change the font of "Default" letters(i.e, tab header name), not the text inside the tabpage. "Default" letters should be in white color and the tab header's back area should be in Black color.
Hope the below picture gives clear idea. If not please send me your mail id, so that I'll send you the screenshot as attachment.
|--------|--> Tab header with name "Default"
|Default |
|-----------------------------------------------------------|
| |
| |
| |
| text inside the tabpage |
| |
| |
| |
| |
|-----------------------------------------------------------|
|
|
|
|
|
Hi everybody,
I want someone help me in my problem!
I made an application in C#, this application has database connection to SQL Server database (LINQ), When I want to deploy the application (make the setup) I added the SQL SERVER EXPRESS as a prerequisite to my application in order to install the SQL server in the client PC, but I had to attach the database file to SQL server manually using SQL Server Management Studio (SSMS) so I also had to install this program in the client PC.
What I want to do is to make the setup attach the database file during the setup process to SQL Server automatically without SSMS, but how? this is my problem..
Can anybody help please!
Thanks in advance!
|
|
|
|
|
Write SQL scripts like:
create database Versioncontrol
ON
( FILENAME = N'C:\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Data\Versioncontrol.mdf' ),
( FILENAME = N'C:\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Logs\Versioncontrol_log.ldf' )
for attach
go
exit
exec sp_detach_db versioncontrol
go
exit
And execute them with: sqlcmd -S localhost\sqlexpress -i attach.sql
|
|
|
|
|
Mr.PIEBALDconsult thank you for replying,
I want to attach the database from C# not from SQL server itself !
Thanks again.
|
|
|
|
|
Then execute those statements via ADO.net
Also note that I modified my response -- see if SQLCMD will do what you want.
|
|
|
|
|
I tried to excute other statments via ADO.net which is:
EXEC sp_attach_single_file_db @dbname = N'{'databasename'}' , @physname = N'{'path'}'
but an exception is occured
|
|
|
|
|
Don't you think including the exception would be helpful
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
The Exception is:
DBAttachException: Cannot create file 'Database (LDF) Path' because it already exists. Change the file path or the file name, and retry the operation.
Could not open new database 'Database name'. CREATE DATABASE is aborted.
File activation failure. The physical file name "Path of my project of .Net" may be incorrect.
I hope that to be helpful !!
|
|
|
|
|
Have you tried the statements I suggested?
What code did you use when you tried?
|
|
|
|
|
I tried your instruction using ADO, and it works..
Thank you very much.
But I want to show you the main reason of my problem, I was using sp_attach_single_file_db
but this instruction attach the database to SQL just if you have already attached it then deattached it !
But if you use this command to attach database for the first time to SQL it thow an exception
Thank you Mr.PIEBALDconsult you were helpful.
|
|
|
|
|
|
Hi to all,
I have made a set up of a project which use some dll files.When I install the setup with version say 1.0, it is installed properly.
I have another set up of same project but this updated say 2.0
Now I nstall 2.0 without uninstalling 1.0 to the same path(path of 1.0).
2.0 replace the 1.0 but those dll files are not replacing, still there are dll files of 1.0 are present.
Please guide me how to solve the problem.
Thanks in adv.
|
|
|
|
|
Have you ensured the assembly versions are being updated in the AssemblyInfo.cs file?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for ur replay.
I have changed the version in AssemblyInfo.cs.
Let me tell what are the versions-
Initially there was 1.0.0.0 version and then I changed it to 1.0.3.0.
Please can u tell me what settings we do in installer so that older overwrites the new.
|
|
|
|
|
I just had a similar problem.
Get Orca, a program which is part of the Microsoft SDK.
Open your .msi installer file in Orca.
Select properties from the left hand side.
Insert a new row into the table:
- Property: REINSTALLMODE
- Value: amus
This will cause your installer to overwrite previous versions when installing.
Remember for each release that you need to update the Version property for the Setup project, which (in VS 2008) will prompt you to create a new ProductCode GUID.
|
|
|
|
|
Hi,
I'm looking for the (class / property / etc) naming rules in c#. I thought 'surely the language specification must have them' and 'surely Google can tell me', problem is I keep finding naming conventions etc etc.
I need the RULES, e.g. You may not start a property name with a number. The stuff that makes the compiler break...
I don't care about upper case vs lower case etc, those are conventions...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
|
Hi, thanks for your reply but I am not looking for design patterns (I am familiar with a vast array of them already), I'm looking for a definitive list of rules for naming in c#
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Ah, i thought design patterns would be ah good basis how to name classes at least. Sorry if my answer couldn't help you.
|
|
|
|
|
You might find the ECMA Spec for C# useful. It's available here[^].
|
|
|
|
|
Another alternative is on MSDN[^]
I are Troll
|
|
|
|