How to make symmetric draws in c# [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have to make a project on "symmetry" theme in c#. I chose to make a symmetric draw. You draw on the left part and it will appear a symmetric drawing on the right one! How to make this with 2 split containers? Thanks!

There are many types of symmetry.
Take a look: https://en.wikipedia.org/wiki/Symmetry_(geometry)
Assuming you just want mirror symmetry, for every point (left_x,left_y) in your left container, the corresponding point in your right container (right_x,right_y) will be calculated as follows:
right_y = left_y;
right_x = width_of_right_container - left_x;

Related

Convert.ToInt32("example") Collisions? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Will the C# function Convert.ToInt32(text) convert different words to the same int? Any links or pushes in the right direction are appreciated!
P.S.
What about anagrams?
No, Convert.ToInt32(text) will just try to parse your text to an int, like:
Convert.ToInt32("032") will return 32 as int but
Convert.ToInt32("Brian") will throw an exception.
I assume that you want to have some kind of hashing, when you say "different words to the same int".
Try GetHashCode(). It will return the same value if you call it multiple times with the same value, for example:
"Brian".GetHashCode() will always return 1635321435

What does (int) mean in c#? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I've encountered sometimes code like this and I am kind of new to programming. I want to find out what's the meaning behind those objects or data type enclosed in parenthesis.
(int)
(datagridview)
(form)
If you see something like this it's called a cast. It's used to explicitly convert a data type to another data type.
double pi = 3.14159;
int my_int = (int)pi;
See this description on casting for more details.

Simulate keyboard typing without using SendKeys [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a random text, which can include special (for sendkeys) symbols like ), ( etc (obvious book, for example). Screening unsuitable too, becouse string send through the internet, so the size of string important. Can you suggest some decision?
Try this and see if your problems go away:
public void TypeCustomMessage(string message)
{
SendKeys.SendWait(Regex.Replace(message, #"(\+|\^|%|~|\(|\)|\[|]|\{|})", "{$1}"));
}

Should the currecy textbox in winforms gets rounding done all the time? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i have standard windows textbox that is formatted for currency but there is minor issue, when the user enter a value like 19999.9999999, this get rounded to 20000.00. If the user enters the value as 19999.99 this value will not get rounded. In the big industry, what is the correct way to format this number?
I need this to be rounded without harming the property value!
How about Math.Round.
try like this
decimal dValue = Math.Round(19999.999999M, 3);
Take a look at the msdn for complete reference of Math.Round() method.

Is the any restriction in using currently present Image property? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to write some property item to image. Though I could not do it. But I can edit any currently added property. So I want to know is there are any property item I can use for my purpose? Here are some Id I am getting:
Id:271
type 2
Id:272
type:2
Id:274
type:3
Id:282
type:5
Id:283
type:5
Id:296
type:3
Id:306
type:2
....
etc.
My question is can I use any of the currently present property?
Sounds simple i think
<img id="myimage" data-id="data you want to pass"/>
if you want to add attribute from c# then
ddLedger.Attributes.Add('data-id','yourvalue');
So you want to access this property at backend c# then
string aa=myimage.attributes("data-id");
in string aa you will get your data....
and in jquery
$('#myimage').attr('data-id');
Now if you want to add it at run time then like this
$('#myimage').attr('data-id','your id added');
Demo
Check this url for more details
https://stackoverflow.com/a/1735239/2630817
I hope this will help you....:)

Categories

Resources