|
I don't think there is such a property. You can use a different icon to represent pressed and unpressed states and will be more clear. You can also change the background color when pressed and unpressed.
|
|
|
|
|
Hi! I'm wondering is there some algorithm to calculate a math function's limit: Wikipedia[^]
Still learning...
|
|
|
|
|
Hi,
nike_arh wrote: calculate a math function's limit
numerically? yes
analytically/symbolically? yes, much harder though
Google!
modified on Sunday, January 18, 2009 5:32 PM
modified on Friday, June 10, 2011 12:17 PM
|
|
|
|
|
Hey guys.
What are the differences between int? and int ?
Thank you
|
|
|
|
|
Nullable types can represent all the values of an underlying type, and an additional null value. Nullable types are declared in one of two ways:
System.Nullable<t> variable
-or-
T? variable
see more:
http://msdn.microsoft.com/en-us/library/2cf62fcy(VS.80).aspx[^]
Human knowledge belongs to the world
http://www.rad.pasfu.com/index.php
|
|
|
|
|
A good response Reza.
Thank you
|
|
|
|
|
Hi guys,
I am working on a tool to test a website. Here is a short version of the code to highlight where I am having issues:
namespace Tao
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string Refresh()
{
this.webBrowser1.Url = new System.Uri("www.someURL.com", System.UriKind.Absolute);
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
string PageText = this.webBrowser1.DocumentText.ToString();
return PageText;
}
public void button1_Click(object sender, EventArgs e)
{
string Page = Refresh();
webBrowser1.Document.GetElementById("submit").InvokeMember("click");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
Thread.Sleep(5000);
}
}
}
I have removed a lot of code to simplify this post. Basically, the form has a button that starts a loop around the browser refresh and the button click for submit. When the Refresh() object executes, because of the WebBrowserReadyState.Complete & DoEvents() objects, the webpage loads completely before the submit button is clicked. My problem is that I cannot get the brower to wait after I send the click element before the refresh action executes again. To be more clear, I hear it submit the click command, but the page does not refresh to the redirected page either before, during, or after the Thread.Sleep(5000) executes. I would like to see the redirect page after I click submit and I would like it to fully load before I execute the entire loop again. Can someone please suggest how I can make this happen?
If this description needs to be clarified, please chime in and thank you for anyone that can help me with this,
Joe
|
|
|
|
|
Hello,
In my application I scan image (by C# code) and I save in local disc (by C# code),but problem is: the image is very large with size 1.50MB after it is saved in local disc.
How can I decrease size of scaned image by C# code?
Regards.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
You could compress it using GZip[^].
/ravi
|
|
|
|
|
Hi,
Image.Save has many overloads, don't just use myImage.Save(myFilename);
the file size depends on many things:
- the image size in pixels (width and height); do you actually need that resolution?
- the number of bits per pixel (e.g. 24 bpp);
- the image format (see ImageFormat class).
It all depends on what you want or need. You can reduce the number of pixels (by resampling the image), you can reduce the number of bits per pixel, or you can choose an image format with high(er) compression.
Some formats have no compression, some can compress but don't do so by default, some (e.g. JPEG) perform
compression and allow a choice from best quality to most compact.
Another way to reduce image size is reducing the number of different colors to 256 and use an
indexed image, that way it takes 1 byte per pixel.
|
|
|
|
|
Thank you for your answer,I figured out based on your suggestions.
Finally I used ImageFormat and it works good.
My best regards.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
You're welcome.
|
|
|
|
|
I have a project where I'm using SetWindowPos through pinvoke to show a frameless window. In Windows Vista, when the window would load, there would be no window opening animation, but now that I'm running the project in Windows 7 the animation is there.
I'm now trying to use AnimateWindow to change the opening animation so that the length is 0. But I'm having trouble accomplishing anything with AnimateWindow except changing the behavior to hiding the window instead of showing it.
Is there anyone who can help?
Do we have any forum here specifically for Win32 API discussions?
|
|
|
|
|
Given the following code:
namespace WinServices
{
public enum SC_ACTION_TYPE
{
SC_ACTION_NONE=0,
SC_ACTION_RESTART=1,
SC_ACTION_REBOOT=2,
SC_ACTION_RUN_COMMAND=3
}
}
using WinServices;
public class MyClass
{
private static WinServices.SC_ACTION_TYPE m_actionType1 =
WinServices.SC_ACTION_TYPE.SC_ACTION_NONE;
private static WinServices.SC_ACTION_TYPE m_actionType2 =
WinServices.SC_ACTION_TYPE.SC_ACTION_NONE;
private static WinServices.SC_ACTION_TYPE m_actionType3 =
WinServices.SC_ACTION_TYPE.SC_ACTION_NONE;
}
Why am I getting a CLS compliance warning with this code (the property name - bolded, italicized, and underlined - is where the warning is happening)?
using WinServices;
public class MyClass
{
public static WinServices.SC_ACTION_TYPE ActionType1
{ get { return m_actionType1; } }
public static WinServices.SC_ACTION_TYPE ActionType2
{ get { return m_actionType2; } }
public static WinServices.SC_ACTION_TYPE ActionType3
{ get { return m_actionType3; } }
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are both the enum and the class in the same assembly? If they are, is the assembly marked CLSCompliant ( the default is false ).
Have you tried explicitly marking the enum as compliant?
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Nick Butler wrote: Are both the enum and the class in the same assembly
No. Why should that matter?
Nick Butler wrote: Have you tried explicitly marking the enum as compliant?
No. I didn't know I could. Is that really a "good idea" (tm)?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
If the enum is in an assembly that is marked not compliant ( or not explicitly marked as the default is false ), and you try to use it in an assembly that *is* marked as compliant, you will get this warning.
If you don't want to set the whole assembly that contains the enum as compliant, you can just mark the enum as compliant. It's just an option.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
I have:
onchange="resetDest(1)" id="from1Select">
Origin
-------------------------
AUSTRALIA
Adelaide
Ballina Byron
Brisbane
Cairns
Darwin
Fraser Coast
Gold Coast
Hamilton Island
Hayman Island
Hobart
Launceston
Mackay
Melbourne (all airports)
Melbourne - Avalon
Melbourne - Tullamarine
Newcastle
Perth
Rockhampton
Sunshine Coast
Sydney
Townsville
Whitsunday Coast
-------------------------
CAMBODIA
Phnom Penh
Siem Reap (Angkor Wat)
-------------------------
HONG KONG
Hong Kong
-------------------------
INDONESIA
Denpasar (Bali)
Jakarta
Medan
Surabaya
-------------------------
JAPAN
Nagoya
Osaka (Kansai International)
Tokyo (Narita International)
-------------------------
MACAU
Macau
-------------------------
MALAYSIA
Kota-Kinabalu
Kuala Lumpur
Kuching
-------------------------
MYANMAR
Yangon
-------------------------
NEW ZEALAND
Auckland
Christchurch
-------------------------
PHILIPPINES
Manila
-------------------------
SINGAPORE
Singapore
-------------------------
TAIWAN
Taipei
-------------------------
THAILAND
Bangkok
Phuket
-------------------------
UNITED STATES
Honolulu
-------------------------
VIETNAM
Buon Me Thuot
Can Tho
Da Lat
Danang
Ha Noi
Hai Phong
Ho Chi Minh City
Hue
Nha Trang
Vinh
I do code:
webBrowser1.Document.GetElementById(select).InvokeMember("onchange()", "resetDest(1)");
I want to start function
onchange="resetDest(1) .
What do I do?
Thanks you very much
|
|
|
|
|
Hey, I have button in a Form, I implemented its Click handler as when its clicked an X is drawn.... I obtained the Graphics using the CreateGraphics() method of the button used it to call the DrawLine methods..
When I click it, it draws the line properly but when I move the mouse outside the button's boundary it vanishes. why?
The code for the click event handler is
private void button1_Click(object sender, EventArgs e)
{
Graphics g = button1.CreateGraphics();
g.DrawLine(new Pen(Color.Black), 20, 20, 200, 200);
g.DrawLine(new Pen(Color.Black), 200, 20, 20, 200);
}
|
|
|
|
|
When you say an X is drawn, do you mean on the button or on the form?
Also, you have to realize that any event that alters the form visually like a drag & drop or a mouse movement, you would need to "invalidate" the present form so that it would redraw itself.
|
|
|
|
|
I get the graphics from the button's CreateGraphics method and draw with it, this means that I'm drawing on the button right?
When I move the mouse inside the button's boundary it doesn't redraws, why? as soon as it gets outside the button, the drawing is gone Here, what is being redrawn? the button or the form?
|
|
|
|
|
Colin gave you the answer, much better than I did.
|
|
|
|
|
Ahmed Manzoor wrote: I get the graphics from the button's CreateGraphics method and draw with it, this means that I'm drawing on the button right?
Yes.
Ahmed Manzoor wrote: When I move the mouse inside the button's boundary it doesn't redraws, why? as soon as it gets outside the button, the drawing is gone
Because when you click a button, or hover over it the drawing of the button changes to give feedback to the user. For example when you click a button it looks pushed down, when you release your mouse button it pops back up again. Each of those drawing operations overwrite any previous drawing operations.
You draw onto the button directly. As soon as the user does anything that requires the button to redraw (clicking the button, hovering over the button, stopping hovering over the button, minimising the window, resizing the windows, moving the window, etc. etc.) then your drawing is gone and replaced with what ever the button control needs to draw.
Ahmed Manzoor wrote: Here, what is being redrawn? the button or the form?
Depending on what triggered redrawing it could be a number of things. That is why there is an OnPaint method. Regardless of what caused the button, or its parent control, or its parent form to be redrawn, OnPaint will get called.
You must therefore override the Button's OnPaint method and supply your additional drawing code in there.
|
|
|
|
|
Colin Angus Mackay wrote: Ahmed Manzoor wrote:
I get the graphics from the button's CreateGraphics method and draw with it, this means that I'm drawing on the button right?
Yes.
No.
It means that you are drawing on the screen where the button happens to be. The button is not at all aware of your drawings.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: It means that you are drawing on the screen where the button happens to be.
That is true in all cases regardless of the control. You only ever draw on the screen where other things happen to be.
Guffa wrote: The button is not at all aware of your drawings
I can draw on my kitchen table, it isn't aware of my drawing either. I suppose it would have been more correct to say "over" rather than "on", but since it is a 2D surface you can't really have "over".
|
|
|
|