|
If u are using a PictureBox then the picturebox is always in a rectangular
form, u can use the Region property of the picturebox which returns an object
of the System.Drawing.Region, the u can get the bounds of the Region
using the GetBounds method of the region object
Hope that works for u
Regards,
Pramod
|
|
|
|
|
How do make my Search function which built-in in Crystal Report work?? should i write coding for particular function even tat oledi display in my interface??
angela
|
|
|
|
|
lot of samples of crystal reports
Crystal Reports
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
In one of my application i want to check for the internet connection can any one give me the code for it
Mahammadhusen
|
|
|
|
|
Just execute the Ping command of the System and check the
response that is returned after the execution,
e.g. Ping "Yahoo.com"
this can be executed from the commandline
C:\Documents and Settings\Administrator>ping "Yahoo.com"
Pinging Yahoo.com [216.109.112.135] with 32 bytes of data
Reply from 216.109.112.135: bytes=32 time=512ms TTL=250
Reply from 216.109.112.135: bytes=32 time=574ms TTL=250
Reply from 216.109.112.135: bytes=32 time=526ms TTL=250
Reply from 216.109.112.135: bytes=32 time=525ms TTL=250
Ping statistics for 216.109.112.135:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 512ms, Maximum = 574ms, Average = 534ms
The above response means the connection is available
u just need to execute the Ping system command from ur application
Regards,
Pramod
|
|
|
|
|
Your proposal can work but the better way to do it is as follows (from MSDN):
Uri myUri = new Uri("http://www.yahoo.com");<br />
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(myUri); <br />
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); <br />
if (myHttpWebResponse.StatusCode == HttpStatusCode.OK)<br />
Console.WriteLine("\nRequest succeeded and the requested information is in the response ,Description : {0}",<br />
myHttpWebResponse.StatusDescription);<br />
if (myUri.Equals(myHttpWebResponse.ResponseUri))<br />
Console.WriteLine("\nThe Request Uri was not redirected by the server");<br />
else<br />
Console.WriteLine("\nThe Request Uri was redirected to :{0}",myHttpWebResponse.ResponseUri);<br />
myHttpWebResponse.Close();
I used to be vain.... BUT now I'm perfect!
|
|
|
|
|
<br />
<br />
[DllImport("wininet.dll")]<br />
private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue) ;<br />
<br />
public bool IsConnected()<br />
{<br />
int connectionDescription = 0;<br />
return InternetGetConnectedState(connectionDescription , 0);<br />
}<br />
<br />
|
|
|
|
|
Your reply is still the best way to check if you only want to determine if the computer is connected to the internet. As soon as you want to see if a specific site is available I would use the example I posted.
I used to be vain.... BUT now I'm perfect!
|
|
|
|
|
Howdy,
Hope somebody can help me. I have a C# Windows Application (.Net 2) and on it is a label. I add an event handler for the label_MouseClick event. The event handler is called when I click the label so it all works as advertised. My question is, how on earth do I capture that the left and right buttons were clicked together? I can check the MouseEventArgs object to get the button used, but don't have and option for both buttons. Is there any easy way to capture the two buttons' click or must I write a whole bunch of code to check for both buttons? Any help would be appreciated.
I used to be vain.... BUT now I'm perfect!
|
|
|
|
|
You can get the Mousebuttons in the MouseDown event,
use the MouseEventArgs object and check the button property
e.g.
if(e.Button == System.Windows.Forms.MouseButtons.Left)
{
//Todo
}
else if(e.Button == System.Windows.Forms.MouseButtons.Right)
{
//Todo
}
Hope that works for u fine.
Regards,
Pramod
|
|
|
|
|
That part I do understand and it is rather easy. To quote my original question: "My question is, how on earth do I capture that the left and right buttons were clicked together?"
I used to be vain.... BUT now I'm perfect!
|
|
|
|
|
It can never ever on Earth happen that Left and Right buttons are clicked together, the user clicks it together but only one click is trapped first by the O.S.
The O.S gets the click of either button and then the other so u can
check both of them by writing Two if conditions.
Wht do u want to do by checking both buttons?
Regards,
Pramod
|
|
|
|
|
"Wht do u want to do by checking both buttons?"
Same as on the MineSweeper game, when I click both buttons I want to mark something.
I used to be vain.... BUT now I'm perfect!
|
|
|
|
|
Here is a solution that works OK (not great but it works):
<br />
<br />
private bool rightButton;<br />
private bool leftButton;<br />
<br />
private void newLabel_MouseDown(object sender, MouseEventArgs e) {<br />
if (e.Button == MouseButtons.Left) {<br />
leftButton = true;<br />
}<br />
if (e.Button == MouseButtons.Right) {<br />
rightButton = true;<br />
}<br />
}<br />
<br />
private void newLabel_MouseClick(object sender, MouseEventArgs e) {<br />
if (e.Button == MouseButtons.Right) {<br />
} else if (e.Button == MouseButtons.Middle || (leftButton && rightButton)) {<br />
} else {<br />
}<br />
}<br />
<br />
private void newLabel_MouseUp(object sender, MouseEventArgs e) {<br />
rightButton = false;<br />
leftButton = false;<br />
}<br />
<br />
I used to be vain.... BUT now I'm perfect!
-- modified at 6:31 Monday 20th March, 2006
|
|
|
|
|
|
Well, no more problem, this is my solution to the problem. Thought I would give feedback.
I used to be vain.... BUT now I'm perfect!
|
|
|
|
|
Thanks a lot,
well are u creating any game in c#?
If u could tell me in detail, it would be gr8!!
Thanks,
Pramod
|
|
|
|
|
I just re-wrote Microsoft's MineSweeper to see if I could do it. It took me 8 hours and 747 lines of code (excluding saving of high scores and sound effects) and the last thing I had to sort out was the clicking of both buttons to expose the buttons that doesn't have mines under it. Nothing spectacular, just a little exercise over the weekend.
I used to be vain.... BUT now I'm perfect!
|
|
|
|
|
private void mylabel_MouseClick(object sender, EventsArgs e)
{
if(e.MouseButton == MouseButtons.Left)
MessageBox.Show("You've just pressed the Left mouse button!");
else if(e.MouseButton == MouseButtons.Middle)
MessageBox.Show("You clicked the middle mouse button");
else if(e.MouseButton == MouseButtons.Right)
MessageBox.Show("You clicked the right mouse buttom");
}
|
|
|
|
|
Hello,
When developing a Windows Application, You may have to put lots of controls on same form. Therefore It becomes too difficult to see, manage and manipulate all of these overlapped controls.
I think, it is a frequently encountered problem. Are there an way to solve this?
|
|
|
|
|
Hi
that's when the Containers technique comes handy
a container is much like a standalone subform has its own controls when you you move the container you move all the contained controls
examples of containers
Panel, GroupBox,TabControl, ToolBar
you can take the "Folder Options" Dialog as an example of how microsoft manage toooooooo many overlapped controls in one single form
through frames and tabPages
Ahmad Shaban
|
|
|
|
|
Hello!
I try to build a class library but I run into some problems.
In the code for this class library there are some rows that have this kind
of look
public bool IsBottomMixValid(MeltPracDataGmix.BottomBlowing mix, int
maxBottomFlow)
As you can see here we have a class named MeltPracDataGmix that exist in the
code for the project
that build the actual exe file. So the class definition does not exist in
this project for this class library.
My qustion is what is the solution to this kind of problem.
I assume if this was C++ it would be enough to include the class declaration
which is the header file.
But in C# we don't have any header files. So how do I do here?
//Tony
|
|
|
|
|
Hi
i don't understand you ! do you wanna pass the constructor or a method in the class
public bool IsBottomMixValid(MeltPracDataGmix.BottomBlowing mix, int<br />
maxBottomFlow)
is BottomBlowing a static method or property or what !!
Ahmad Shaban
-- modified at 4:07 Monday 20th March, 2006
|
|
|
|
|
Hello!
Here below I have been more specific to my problem.
I thing that you can understand what my problem is.
I'm trying to build a class library which has a class called
AvestaPlantFunc.
In this project building a class libray exist a class called
AvestaPlantFunc. In this class is there a method called IsBottomMixValid.
Code not relevant for the question has been removed.
This method IsBottomMixValid has one parameter and the type for this
parameter is MeltPracDataGmix meaning passing class reference
MeltPracDataGmix.
Now to my question the definition for class MeltPracDataGmix does not exist
in the same project as
the class AvestaPlantFunc. Class MeltPracDataGmix exist in another project
that build the exe file.
When a class has a reference to another class as in my example is it
nesessary that the full definition to class MeltPracDataGmix is existing in
the same project.
I assume if this was C++ it would be enough to include the class declaration
which is the header file and not the implementation.
But in C# we don't have any header files. So how do I do here?
What is the solution to this problem when the class need another class.
using System;
using MeltPracData;
namespace Common
{
public class AvestaPlantFunc
{
public bool IsBottomMixValid(MeltPracDataGmix mix)
{
//here is there some code
}
}
}
//Tony
|
|
|
|
|
Hi
You are building a Class Library (dll)
look for the namespace of The class MeltPracDataGmix
and add this refrence in your project
using TheNamespaceThatHoldstheClassMeltPracDataGmix;
C# use the namespace technique instead of the header technique
C, C++ ---> #include <stdiol.h>
.Net ( including C# ) ---> using System;
Ahmad Shaban
|
|
|
|