|
The AllowFullOpen disabled the "Define Costom Colors" as you said.
But some of the colors which the user still can select are not named colors.
At my Dialog, the color on the fourth row in the right side(somekind of blue color i think)
does not return a name, it gives me this code insted "ff8000ff" when i try to get the name.
Basicly my problem is very simple, i wants the colordialog to show colors
which only return named colors, so i can use them through the System.Drawing.Color.FromName event.
Is that possible?
|
|
|
|
|
Hello guys,
Does anybody know where i could find a decent reference for configuration files for .net 2.0
besides msdn2.microsoft.com ?
|
|
|
|
|
Im trying now to get the coords of the mouse on the SCREEN out side my form
i was thinking to use win32 WindowProc function on the desktop handler
( using getDesktopWindow() )
im familiar with using external functions like getDesktopWindow
but i just have no clue how to use WindowProc function ..
it suposed to get callback function or something
how to do it in c# ???
thanks
|
|
|
|
|
Have a look at System.Windows.Forms.Cursor.Position.
|
|
|
|
|
But it will only give me the position can i make a function which will catch mousemove event outside the window?
|
|
|
|
|
Search for global hooks here on CodeProject and you'll find some articles that describe how to do what you're looking for.
www.troschuetz.de
|
|
|
|
|
|
I have following:
string dec = "2";
string amount = "1000"
I want to put a decimal in 1000 based on dec number. So for instance if dec=3 >>> amount should become 10.000....if dec = 2, amount=100.00
How can I achieve this type of operation??
regards
|
|
|
|
|
how about something like this:
<br />
int iDec = int.Parse(dec)<br />
double dAmount = double.Parse(amount)<br />
dAmount *= 10;
dAmount /= Math.Pow(10,iDec);<br />
Amount = dAmount.ToString("f" + iDec);<br />
<code>
|
|
|
|
|
or
amount.Substring(0,amount.Length-(dec[0]-'0'))+"."+amount.SubString(amount.Length-(dec[0]-'0')
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
this worked for me. thanks
|
|
|
|
|
Is there any equivalent of the _MFC_VER macro for the C# preprocessor that allows the user to detect the CLR version at compile time? I saw something like _CLR_VER in the 2005 C++ docs, but nothing for VB.net, C# or C++ for the .NET 1.0, 1.1 versions. ( I am using C# 2003 latest service packs.)
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
No, there isn't.
If you using C# 2003, you'll be compiling using the .NET Framework 1.1. VS.NET 2003 will NOT compile using 1.0 or 2.0 of the .NET Framework.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
There isn't. Java and .Net have been gravitating away from the concept of a "pre-compile" step so there is no "preprocessor" to mess with. I believe ultimately this is a good thing since it leads to cleaner, far more readible code.
More to the point, why do you need to know, at compile time, what version of the CLR is available? You need to remember that a machine might have multiple versions (if not multiple implementations) of CLR available to run against. What would one do with such information in any C# code anyway? Versioning is handled by attributes and metadata where the compiler doesn't care (beyond generating correct IL).
|
|
|
|
|
I was concerned with the availability of obsolete functions or methods from one version of the CLR to another. With a CLR version compile time symbol definition I hoped to avoid all those obsolete methods messages.
I will have to perform run-time detection of the CLR, but was hoping to use a ConditionalAttribute with the CLR version for source I might distribute that would work on 1.1 or 2.0 of the CLR.
Oh well.
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
hi to all,
in a listview how can align right only the data in the column without the title of the same column.
in other word :
the title must be align to the left and the data must be align to the right
best regards and thanks in advance
fady
|
|
|
|
|
I'm learning C# and am using VS.net 2003 with SQL server 2005. I have a table called Train_Schedule with a filed of type smalldatetime called Arrival_Time .
I created a typed dataset called Train (similar in structure to Train_Schedule ) and bound it to my datagrid, stationGrid . In my form, I have a datetimepicker called arrivalTimePicker , which displays the time in a custom format of hh : mm tt . The MaxDate and MinDate properties are set to the current date, so the user can only select the time.
In a button click's event handler, I have the following code:
string arrivalTime = arrivalTimePicker.Value.ToShortTimeString();
MessageBox.Show(arrivalTime);
object[] rowData = new object[5];
rowData[0] = trainNumber;
rowData[1] = stopNumber;
rowData[2] = stationCode;
rowData[3] = arrivalTime;
rowData[4] = departureTime;
DataSet trainDataSource = (DataSet) stationGrid.DataSource;
trainDataSource.Tables[0].Rows.Add(rowData);
But the grid displays only the date, not the time. How can I display the time and not the date in the datagrid?
Thanks in advance!
Cheers,
Vikram.
Google talk: binarybandit upsdude: when I looked at laurens profile, a couple of gears got stripped in my brain.
Michael Martin: Too bad she bats for the other team.
|
|
|
|
|
Have you tried -
string arrivalTime = arrivalTimePicker.Value.ToString("hh:mm:ss");
|
|
|
|
|
I have some code that builds a web form datagrid on the fly. This method ...
{
bc = new BoundColumn();
.
.
.
if( c.ItemType == "Time" )
{
bc.DataFormatString = "{0:t}";
bc.ItemStyle.Wrap = false;
}
if( c.ItemType == "Date" )
{
bc.DataFormatString = "{0:d}";
bc.ItemStyle.Wrap = false;
}
DataGrid1.Columns.Add( bc );
}
... seems to work for me.
-- modified at 8:51 Tuesday 18th October, 2005
|
|
|
|
|
Stan, I'm using a Windows forms application. I don't generate columns on the fly; rather, I use a typed dataset.
DataFormatString is not a property of System.Data.DataColumn .
Any workarounds?
Woah! Managed to post this after 1+ hour of trying!
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
Google talk: binarybandit After all is said and done, much is said and little is done.
|
|
|
|
|
|
Hi,
Is there anyway of differentiating whether a controls Leave event was fired by a "TAB" out of the control or by a "Mouse Move" out of the control. I am trying to pop-up a window whent he user "tabs" out of a control which is fine but it is also happening when they "mouse move" out of the control. I am using the controls Leave event. Any help will be greatly appreciated.
Thanx
Craigo
|
|
|
|
|
I would imagine (although I haven't tried this) you could intecept both the MouseMove and the KeyDown events for your control then in the KeyDown event check for the tab key and if it was pressed set a flag, lets call it TabPressed, to true (else false). In the MouseMove event you would set TabPressed to false. When your control Leave event fires you can then check if TabPressed is true and pop-up your window if it is, else don't.
|
|
|
|
|
Thanx for the reply....the problem is that you cannot trap the Tab key on the KeyDown event becase when you press the tab key it doesnt fire the keydown event, only the OnLeave event fires.
|
|
|
|
|
Hmmm....what if you set the KeyPreview property of the form that contains your control to true and handle the KeyDown event there? Will that let you see the KeyDown before the OnLeave event?
-- modified at 9:47 Tuesday 18th October, 2005
Actually, another thought. Perhaps you could check the mouse position using Cursor.Position in your OnLeave event and check to see if it is within your control or not?
Or better yet (maybe) perhaps you need to handle the MouseEnter and MouseLeave events for your control. Keep a flag (set on the MouseEnter and MouseLeave events) of whether the mouse is within the control. When the control first gets focus store the current state of that flag. On your OnLeave event check to see if the current flag state indicates that the mouse is outside the control where before it was inside. There are some details there that you'd have to work out, but it's something to think about.
|
|
|
|