Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Firstly hi everyone;

I'm develop new software for improve myself. But I'm stuck somewhere.

I'm developing video player with subtitle. All subtitle words are control. All subtitle words have mouseenter and mouseleave and this controls are clickable.

Subtitles need to be centered in the video player screen but I can't do it.

For better understanding, I'm add image. I hope, I explain what I want to do..

Thanks for all answer...

http://tinypic.com/view.php?pic=33dzjv7&s=8#.VDMvQvl_vh4[^]
Posted
Comments
Sergey Alexandrovich Kryukov 6-Oct-14 20:15pm    
It's not a big problem, but first, you need to clarify what do you mean by Control or UserControl. Full type name, please. When it comes to UI, always specify your application type, UI library you want to use.
—SA
Umut Comlekcioglu 6-Oct-14 20:23pm    
I want to align custom controls into User controls.
Sergey Alexandrovich Kryukov 6-Oct-14 22:06pm    
Then align them. You did not answer my questions. None of them. Why should I try to answer?
Also, you did not explain why could not you align your controls.
—SA
Umut Comlekcioglu 8-Oct-14 9:24am    
I'm saying Control because I'm developing Subtitle Words with Custom Control. Then, these subtitle words are need to align on UserControl.

1 solution

I don't get what you mean.
But, i guess you have a "subtitle" control (example, a label) and wanna align it (center) on another control (example, a panel) ? You have label's width and panel's width right ? Just do a little math to adjust label's X location and problem solved.

Example:
label's width is lW, panel's width is pW
=> new label's Location(X) = ((lW+pW)/2) - lW
=> label will placed at panel's center
 
Share this answer
 
Comments
Umut Comlekcioglu 9-Oct-14 13:51pm    
No, every subtitle words need to be clicklable. Subtitle can't be created with Label absolutely.
Nguyen.H.H.Dang 10-Oct-14 2:18am    
Its just an example of how you can align 1 control on to another.
The "label" and "panel" can be any kind of controls. If you wanna a better answer, please improve your question, no one can understand it now.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900