|
I've never seen the problem before.
Are you absolutely sure you added a Class file to the project instead of another Form?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello all
can any one tell me if it is possible to make a car animation in picture box with some background which is also a picture some gif or bmp.if some one can tell me this then it is highly appreciable.thanks
bhatti
|
|
|
|
|
You can manage this also in panel just overriding the OnPaint method. Using PaintEventArgs.Graphics draw background image and the car frame over it.
Use double-buffering to prevent flickering.
|
|
|
|
|
Hi All,
I have this peculiar requirement.....I have a windows application developed in C#. The main form of the application doesnt have a "Title bar" (this is as per the design requirement..)...
Now, whenever we do Alt+Tab, the associated "Icon" as well as the content of the "Titlebar" of any window is displayed in the popup that comes up....But in my case, I can see only the associated Icon, but not the "Title" (as there is no "Titlebar" in the first place) .
Any means by which I can display this info as well, without actually having the "Title" bar
|
|
|
|
|
The only way I can think to do this is to enable/disable the title bar on the form in the "LostFocus" and "GotFocus" events. This way when the form is not in focus, it has a title bar and can be tabbed to. Then when it gets tabbed to the title bar disappears before the user sees it. The only problem here is that when there are two applications on the window side by side, you could lose focus without actually covering up the app so the user may see the title bar every now and then.
|
|
|
|
|
I wonder if u can help me in solving the following problem:
I want to divide a number by 10 and get the result as the highest number.
Let me explain with following examples:
13/10 = 2 and
27/10 = 3
I am using Math.Ceiling to get the higher value, but the problem is that it only works for double value. I have the following code:
decimal weight = 20.1;
decimal MaxWeight = 20;
double weightInDouble = Convert.ToDouble(weight);
double PackageWeight = Convert.ToDouble(MaxWeight);
double NumberOfPackagesNeeded = Math.Ceiling(weightInDouble / PackageWeight);
However, the problem I am facing is that if the weight=20.1 and I convert it to double value, I get 40.2, and this would give me a wrong answer.
So how can I get the higher value when I divide two decimal values.
regards
|
|
|
|
|
Have you actually tried what you are saying here? Im probably not getting you right but calling Convert.ToDouble(someDecimalValue) doesn't give you a value which is doubled. It just converts a number in a decimal format into a double format (which means double precision floating point number). Except for some very slight rounding issues the value will not be changed.
|
|
|
|
|
I am using VS.net debugger to run through my code. And when I convert 20.1 to double, VS.net debugger shows the weightInDouble=40.2
I also get the wrong answer:
double NumberOfPackagesNeeded = Math.Ceiling(20.1/ 20);
Should give me 2... but currently I am getting 3
regards
|
|
|
|
|
Check it again. Following code outputs "2" twice:
decimal weight = (decimal)20.1;
decimal MaxWeight = 20;
double weightInDouble = Convert.ToDouble(weight);
double PackageWeight = Convert.ToDouble(MaxWeight);
double NumberOfPackagesNeeded = Math.Ceiling(weightInDouble / PackageWeight);
Console.WriteLine(NumberOfPackagesNeeded);
NumberOfPackagesNeeded = Math.Ceiling(20.1/ 20);
Console.WriteLine(NumberOfPackagesNeeded);
Note that I changed the first line of code from our original post. The way you posted it gives a compilation error because the compiler identifies 20.1 as a double value which cannot be implicitely casted to decimal. Thats why I had to insert an explicit cast.
|
|
|
|
|
my mistake my mistake my mistake
After re-checking my code, I realised that 40.2 is the correct amount. I am getting "weight" value from database and I was expecting to get 20.1 instead of 40.2. So when I got 40.2, I thought there was something wrong with my application code.
Anyway, thanks again
|
|
|
|
|
Hi,
Can someone please tell me how can I scroll an image?and how can I manipulate its size so that it's adjust it according to the monitor size of the user's monitor?
Thanks,
E.A.
|
|
|
|
|
You scroll an image by changing which part of the image you draw. You change it's display size by drawing it to the size of the window you're drawing on.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I am having a problem with using the IHTMLElementRender in my C# Application.
First I redefine IHTMLElementRender as below
[Guid("3050f669-98b5-11cf-bb82-00aa00bdce0b"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
ComVisible(true),
ComImport]
interface IHTMLElementRender
{
void DrawToDC([In] IntPtr hDC);
void SetDocumentPrinter([In, MarshalAs(UnmanagedType.BStr)] string bstrPrinterName, [In] IntPtr hDC);
On the main form of the application I am have the folowing code
InternetExplorer ie=new InternetExplorer();
object v1="",v2="",v3="",v4="";
ie.Visible=true;
string strUrl="http://blogs.msdn.com/rfarber/archive/2004/10/12/240943.aspx";
ie.Navigate(strUrl,ref v1,ref v2,ref v3,ref v4);
Thread.Sleep(5000);
IHTMLDocument2 idoc=(IHTMLDocument2)ie.Document;
//IHTMLElement el=(IHTMLElement)idoc.body;
//IHTMLElementRender ren=(IHTMLElementRender)el;//System.InvalidCastException
IHTMLElementRender ren=(IHTMLElementRender)idoc.body.GetType().GetInterface("IHTMLElementRender",true);//ren returns as null
Is there any solutions to my problem?
thaks for any help.
|
|
|
|
|
is this question difficult?
why does no o ne repliy?
|
|
|
|
|
1)how can i copy all element of 1 dataset to another dataset
2)i have an datagride in my form and it has a virtual dataset , how can i update this dataset
########################
|
|
|
|
|
Just using Copy() method
Dataset ds=new DataSet();
Dataset dsExisting=new DataSet();
ds=dsExisting.Copy();
For assigning to a datagrid
say datagrid1.DataSource=ds;
bye
|
|
|
|
|
Dear all,
Please let me know how to capture the screen of the other systems which are under LAN from my system.
|
|
|
|
|
You have to install a program on each system that can capture the screen and send it to your system.
---
b { font-weight: normal; }
|
|
|
|
|
Hello
I have an abstract class and a second class that inherits.
My question is.
Which class executes first when I do this in the constructor
public void NoAbstractClassConstructor(): base();
I have several methods in the abstract class and i would like to know if they executes first.
Thanks in advance
Jose
|
|
|
|
|
Pepito Fernandez wrote:
Which class executes first
Huh? If you wanted to know the order of execution of constructors, then the base class constructor executes first before the derived class's. Not 100%[^] true, because field initializers run before the base class constructor is called, but you can safely assume it is true for most cases.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi friends,
I want to access all members of Color enum one by one . any one can help me?
|
|
|
|
|
You are looking for Enum.GetNames[^]. Pass any enum type as a parameter and it returns a n array of strings containing the names of the enum elements. In your case, you need to call it as Enum.GetNames(typeof(Color)); .
Hope this helps.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How can I Draw a string in reverse color of background?It is easy using code like this
private void tb_Paint(object sender, PaintEventArgs e)<br />
{<br />
string text = ((TouchButton)sender).strName;<br />
FontFamily fontFamily = new FontFamily("Times New Roman");<br />
Font font = new Font(fontFamily,12,FontStyle.Bold,GraphicsUnit.Point);<br />
Rectangle rect = new Rectangle(this.iHorizentalSpacing ,<br />
this.iVerticalSpacing , this.iWidth - 2 * this.iHorizentalSpacing<br />
, this.iHeight - 2 * this.iVerticalSpacing);<br />
e.Graphics.FillRectangle(Brushes.Black,rect);<br />
e.Graphics.DrawString(text,font,Brushes.White,rect);<br />
}
but I Want to generate colors and they reverses manually.
Ali Beirami
|
|
|
|
|
Does negating the hex value of the background color work? Something like
Color bgColor = Color.Black;
g.FillRectangle(new SolidBrush(bgColor), 0, 0, this.Width, this.Height);
int val = bgColor.ToArgb();
val = ~val;
Color foreColor = Color.FromArgb((0x000000FF & (val >> 16)), (0x000000FF & (val >> 8)) , (0x000000FF & (val)));
g.FillRectangle(new SolidBrush(foreColor), 0, 0, 100, 100);
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Dear All,
There is a squid server on WinXP (127.0.0.1:8081).
I have a C# application that I want to it redirect ALL HTTP request to squid(transparent proxy).
(application and squid run on same system)
I use GlobalProxySelection and below code in my application, but dont work.
Uri proxyURI = new Uri("http://127.0.0.1:8081");
GlobalProxySelection.Select = new WebProxy(proxyURI);
How can I redirect ALL http request to this proxy server?
Is correct this question!? Can I do it on windows OS?
--TNX
|
|
|
|