|
Alright, I'll use the Math.Round.
Anyway, if I ask the debugger it says 35.0 for the following expression:
float temp = (4.5f - 1.0f)/0.1f;
Weird, isn't it?
|
|
|
|
|
It's me again. I think I've found the problem.
In the known expression
int temp = (int)((4.5f - 1.0f)/0.1f);
((4.5f - 1.0f)/0.1f) seems to be treated as a double value (to be more precise, this kind of double: 34.9999...). But why? Every single number has a nice f as suffix, it should be treated as a float.
Any ideas?
Cheers,
Christoph
|
|
|
|
|
It's only the debugger that uses double values for the calculation. I don't know why.
If you try this:
((4.5f - 1.0f)/0.1f).GetType().FullName
it will give the result "System.Single".
---
b { font-weight: normal; }
|
|
|
|
|
Hi everybody,
i want create a setup surface for an installer. My problem is that i want to select the folder, in which the program should install. For that i want button to select the folder. I´ve one DLL and one Form.cs. How could i do that?
THX
Mamudo
PS: Sorry for my english
|
|
|
|
|
hi
i've a form with buttons at the left and tabpages of information at the right of the form.. my problem is, how can i load my form without the tabcontrol at runtime? i juz want to show what's available at the left of the form at runtime. only after pressing the buttons then the right of my form (tabpages) will be shown..
thanks
|
|
|
|
|
you can make it invisible and set it visible when you need them
but if you need to load them at run time you can do this
remove the tab from InitializeComponent
and write the method that initialize it when you need
call it when you need to load the tab
|
|
|
|
|
Hi!
Unfortunately, TabPage s don't have a Visible property, so you can either make the whole TabControl invisible or remove all unwanted TabPage s from the TabPages collection of TabControl .
You can also add TabPage s to the TabControl at runtime when a menu item is selected.
Regards,
mav
|
|
|
|
|
this code sample load control at run time
Button b=new Button();
b.Name="b1";
b.Text="Text";
b.Location=new Point(25,25);
//add to form
this.Controls.Add(b);
|
|
|
|
|
what do you want to hide at runtime tab control or tab page if you need to hide tab page like mav.northwind said
|
|
|
|
|
hi
at runtime i want tabcontrol to be invisible.. only after i click on some buttons then the tabpage will show.. (i made it to be a particular button will call a particular tab page)
thanks =)
|
|
|
|
|
//to make tabcontrol invisible
tabControl.Visible=false;
//to select particular tabpage
tabControl.SelectedTab=tabPage2;
|
|
|
|
|
I need to add colums to a datagrid.Anybody can tell me how can I do that?
|
|
|
|
|
hi all,
I need to change the Background Color of DateTime Picker.But in the properties, There is no place to change it..
Can any one tell me how to change the Background Color of DateTime Picker using C# ?
thanks in advance..
|
|
|
|
|
Hi all:
Im using Office Programming for my Automation App.
Everything is ok but there is a little problem. I've added an event on BeforeSave for my opened word from App. (the instance from Word.Application) then in BeforeSave even I save the content in a database & its ok then I close the word & then quit the word as follow:
Doc.SaveAs(.........);<br />
Doc.Close(ref TempObj, ref TempObj, ref TempObj);<br />
dbWord.Quit(ref TempObj, ref TempObj, ref TempObj);
TempObj = System.Reflection.Missing.Value
It saves, close & quit word but Office gives me an error.
does anybody seen it!
Always ,
Hovik Melkomian.
|
|
|
|
|
Im trying to send a string with the value:"\xHexaValue" to a vb application.
The HexaValue is of an Ascii code from the charachter table 128-255.
In the VB application Im searching for that value (chr(&HHexaValue)) but the value which was sent was converted to the NOT value of the actual value in Hexa. I tryed use the Encoding methods but without success.
|
|
|
|
|
From where or what are you sending the string? Does it really use ascii code?
Either the value is not converted at all, and still remains as \xnn in the text, or whatever you use to enter the string converted it to a character in a different character set, perhaps ansi or unicode.
---
b { font-weight: normal; }
|
|
|
|
|
|
Hi.Im actually working on a datagrid which shows data from an Access database.I was working till know only with one table so my dataset is configured for one table only.How can I add other tables from the Access database I was using without beggining other C# solution?
|
|
|
|
|
How are you configuring the dataset ? Ideally, you'd have a data access layer which returns datasets based on any SQL query you like.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
And your data access layer can be configured to return another table that can be added to your existing dataset at runtime. Thanks.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
Yes it is working on a SQL query cause actually im going through the Microsoft sample of datagrid using.Now I want to do some stuff by myself thats why need to add some tables.Thank you
|
|
|
|
|
depends on what you want.
Your DataSet can hold multiple tables.
(eg. query = "Select * from TableOne;Select * from TableTwo"; )
When you execute it and Fill the DataSet you'll have two tables in your dataset.
(then you can even set constraints and relations...)
thus:
yourdataset.Tables[0].Whatever;<br />
yourdataset.Tables[1].Whatever;
you can also create a DAL (data access layer which you can reuse.
eg. create a method which takes a query and returns a dataset.
Then you can do something like this:
DataSet myset1 = DalComponent.DoSelect("Select * from TableOne");<br />
DataSet myset2 = DalComponent.DoSelect("Select * from TableTwo");
(don't forget to create a new DataSet in your DoSelect method.
good luck.
No hurries, no worries.
|
|
|
|
|
Hello,
I added a MouseHover event on my usercontrol... just noticed that it uses the argument EventArgs instead of MouseEventArgs, is there a way to get the coordinates of the mouse pointer that is hovering over the control? Or maybe there's a workaround?
Thanks!
Rafferty
|
|
|
|
|
Hi!
You can always use Cursor.Position to retrieve (or set) the position of the mouse pointer.
Regards,
mav
|
|
|
|
|
Ahh! hehe didn't know there is such a class. Thanks Mav!
Rafferty
|
|
|
|