|
Hi
Does anyone have a tip about a nice C#-control for volumesettings ?
The common trackbar will do, but i need one where i can set Backcolor to Transparent, and the standard trackbar does not accept that.
Any tips ?
With Kind Regards
Heino
|
|
|
|
|
Either you search for custom control or you write your own
|
|
|
|
|
Could you create a user control that inherits the trackbar and use SetStyle to allow a transparent backdrop?
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Ok , that could be an idea.
I do not know how to use the SetStyle, but i will check that out.
Thanks.
Heino
|
|
|
|
|
SetStyles(System.Windows.Forms.ControlStyles cs, boolean b)
To try to have a transparent backcolor, you would use setstyle in the initialization of the control.
SetStyle(ControlStyles.SupportsTransparentBackColor,true);
Their are also a few other painting routine properties that you can set to true, the properties assist in reducing flickering from custom paint routines.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Ok..now i have tried , but....
As i can see....i can set my usercontrol to transparancy but i am not allowed to set the Trackbar-control backcolor to Color.Transparent anyway.
Heino
|
|
|
|
|
Are you using .NET 1.1 or .NET 2.0?
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I using NET 2.o and VS2005.
Maybe it's lack of competence from my side, but i cannot figure out how to set the background to transparent of the Trackbar.
The only way i see is to redraw my own style trackbar.
Heino
|
|
|
|
|
Is other methods which show a png-picture in the Window Form ?
Thanks.
|
|
|
|
|
Is png not supported in the bitmap class?
Bitmap b=new Bitmap("C:\yadda.png");
pictureBox1.Image=b;
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi friends,
I have arrise a problem in active report C#.My report width is 6.938 in.But in constructor i have change the margins like that:
float fltMargin = 0.05F;
PageSettings.Margins.Right = fltMargin + 0.10F;
PageSettings.Margins.Left = fltMargin + 0.10F;
PageSettings.Margins.Top = fltMargin + 0.15F;
PageSettings.Margins.Bottom = 0.0F;
And if the report contains two pages it shows two pages in print preview.
BUT THE MAJOR PROBLEM IS THAT WHEN I CLICK THE PRINT BUTTON IT TAKES FOUR PAGES.
i.e TWO BLANK PAGES.
Please help me in this solutions.
Thanks.
|
|
|
|
|
i am getting same issue... please help...
Best Regards,
Wahyu
|
|
|
|
|
hi 4 all
when i try to limit installation for my application there is some problem occured , i need to protwct my application from any hacking ...
1- i need to limit install from cd (one installation for any cd ) and dont copy this cd .
2- this application contain mdb ( accses database) how can i making backup for this database .
3- when i install application , copy program folder from ( c:\program file \ my application ) and paste this folder in another computer it work probably, how can i prevent this hacking
thanxxxx for all
|
|
|
|
|
Any idea why do I get this stupid exception when I actually want to open a connection!!
ConnectMe = new OracleConnection("Data Source=orcl; Persist Security Info=True;User ID=DLDSP; Password=DLDSP;Unicode=True");
ConnectMe .Open();
ps. The database is running fine from Sql*Plus
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Error: ORA 6413
Text: Connection not open.
------------------------------------------------------------
Cause: Unable to establish connection.
Action: Use diagnostic procedures to ascertain exact problem.
Solution Description
--------------------
You are starting the application from a directory with a special
character in the name.
A simple testcase:
create a directory c:test(4)
copy odbctst.exe to this directory and start it from this directory
you will get the ora-6413 when trying to connect to an oracle database
The error is caused by the paranthesis in the directory name.
Remove the special characters from the directory name and everything
will work as designed.
Thanks to MSDN Forums
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
hi
the code below throws this exception
"ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized."
on the update statement in the try catch block. Please help.
DatabaseDataSet.PersonnalInfoDataTable ds = new DatabaseDataSet.PersonnalInfoDataTable();
DatabaseDataSetTableAdapters.PersonnalInfoTableAdapter adapter = new Testing.DatabaseDataSetTableAdapters.PersonnalInfoTableAdapter();
adapter.Fill(ds);
DatabaseDataSet.PersonnalInfoRow newrow = ds.NewPersonnalInfoRow();
newrow["firstname"] = this.textBoxFirstName.Text;
newrow["lastname"] = this.textBoxLastName.Text;
newrow["telephone"] = this.textBoxTelephone.Text;
ds.AddPersonnalInfoRow(newrow);
adapter.Connection.Open();
SqlTransaction myTrans= adapter.Connection.BeginTransaction();
try
{
adapter.Update(ds);
myTrans.Commit();
ds.AcceptChanges();
}
catch(Exception l)
{
myTrans.Rollback();
ds.RejectChanges();
}
adapter.Connection.Close();
Nana
|
|
|
|
|
I have torn the Web apart looking for a solution. The only thing I have found that makes any sense, doesn't work for me. I want to hit the Enter key, read the previous line (the line the cursor just left) and determine how many spaces and/or tabs are before the first character. Then, place the cursor at the same position on the current/new line by adding the correct number of spaces and/or tabs before it including the tabs and/or spaces that may or may not already be there. I know there are controls/classes for sale out there that offer all the cool stuff for smart indenting and syntax highlighting, but I'm not a wealthy man.
private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
e.Handled = true;
int pos = richTextBox1.SelectionStart;
int lineNumber = richTextBox1.GetLineFromCharIndex(pos);
String currentLineStr = richTextBox1.Lines[lineNumber];
int firstChar = 0;
while (firstChar != currentLineStr.Length)
{
if (!Char.IsWhiteSpace(currentLineStr[firstChar])) break;
firstChar++;
}
String indent = currentLineStr.Substring(0, firstChar);
richTextBox1.SelectedText = indent;
}
}
Thanks in advanced for any help...
(I may be asking about syntax highlighting after I get this part worked out, if I can't figure it out.)
|
|
|
|
|
Try:
int lineNumber = richTextBox1.GetLineFromCharIndex(pos-1) ;
richTextBox1.Lines[] is a zero index array, but in your example if I press enter on the first line GetLineFromCharIndex returns 1 not 0, so you loop was reading data from the wrong line. According to the documetation GetLineFromCharIndex returns on a zero index as well, so I knew that wasn't the problem. My next thought was that the enter key had been processed, but that didn't make sense because the code is in the keypress event handler.
Here is what I finally figured out... You are getting the selection index which is at the end of the line. This puts it one past the last character. Because of this GetLineFromCharIndex seems to consider it on the next line. So if you do GetLineFromCharIndex(pos-1) which gets the character before that, then everything works out.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Judging from your concise and confident reply, I have to assume you tested your suggestion. That being said, if it's still not working for me after I made your suggested modifications, what am I doing wrong? Could the TextChanged event be interfering? Thank you for your help.
private void RichTextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
e.Handled = true;
int pos = RichTextBox1.SelectionStart;
int lineNumber = RichTextBox1.GetLineFromCharIndex(pos - 1);
String currentLineStr = RichTextBox1.Lines[lineNumber];
int firstChar = 0;
while (firstChar != currentLineStr.Length)
{
if (!Char.IsWhiteSpace(currentLineStr[firstChar])) break;
firstChar++;
}
String indent = currentLineStr.Substring(0, firstChar);
RichTextBox1.SelectedText = indent;
}
}
-- modified at 1:23 Saturday 26th May, 2007
|
|
|
|
|
First, how is it not working?
Second, I would suggest that you put break points in the keypress event, change event and any other relevant code. Watch it execute line by line... which is what I did. If necessary comment out the change event code and any other relevant code and execute without it. I copied your code above and tried it again and it still works, so something else is going on.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
I placed the code into a new project with nothing but the form and the richTextBox. It still didn't work. There are no errors, however, when I run the app nothing happens when I hit Enter -- I.E. no spaces and/or tabs are added before the cursor on the next line. Is there another way to do this?
|
|
|
|
|
I enabled tabs ont the control. Ran the app and tabbed over once and typed text. Pressing enter took me to a new line and inserted the tab. Pressing enter in the middle of my text moved the remaining text after my position to the next line with tabs. I'm in 1.1 framework, don't know if it matters. Did not try pressing enter without any text or pressing enter at the very beginning of a line. Will look at the project again tonight when I get the chance and see if anything else comes to mind and if not may post the project code.
|
|
|
|
|
I'm using Vista Home Premium, Visual Studio 2005 and .Net 3.0.
|
|
|
|
|
Ok I tried it in 2.0 XP. Code still worked. Best of luck.
|
|
|
|
|
One for the "duh" files.
I figured out why it wasn't working for me.
I hadn't added the KeyPress event to my richTexBox control.
Thanks for your patience and help.
|
|
|
|