In my wp7 app, I use C# to create user interface. I want to create a round button in C# not in xaml. is it possible to do that only in C# (not with the help of xaml) ? if yes, how to do this? and also please explain how to change a style of a button or any other control by using C# code?
Yes you can but don't know why you'd want to. Much easier to do with styles. Even easier to use one from an existing toolkit.
There is a round button in the Coding4Fun Phone Toolkit.
Get it via NuGet or download it here
Related
I am currently porting my application from WPF to Cross-platform. In the WPF, I used a read-only richtextbox to show the result to user in order to show both IMAGE & TEXT. In Xamarin.Forms, Is there anything similar? Thanks.
There is no control in Xamarin Forms, hence you would have to use CustomRenderers and create your own.
However I only found one decent RichTextBox implementation in
UWP RichTextBox
This means that the only way to get any decent RichTextEditor, is to use a WebView, and load a WebBased rich text editor.
But since you want it as read-only, the simplest thing to do, is to scrap the idea of any RichTextBox, and just display the text and image as separate components in your mobile app.
You can use Spans, in a label to implement formatting within the label if needed.
I found the Telerik RichTextEditor for Xamarin a much better Rich Text Editor package for Xamarin Forms after trying out and evaluating a handful of other alternatives.
This is licensed software and you have to pay for using it.
Here's the link, https://docs.telerik.com/devtools/xamarin/controls/richtexteditor/richtexteditor-overview
ScrollView can be used like readonly richtextbox. I added the elements programmatically(label for text and image). It's also read-only so it met my requirements
Syncfusion's brand-new rich text editor control for Xamarin.Forms is available now. Check out the following article for more detail.
https://www.syncfusion.com/blogs/post/introducing-xamarin-forms-rich-text-editor.aspx
How can I open the TimePicker to select new time but from C#? Not by tapping the control.
Is there any simple way to do that?
I had the same problem once. I solved it by forking the Windows Phone Toolkit and making the OpenPickerPage of the control public.
(I assume you mean the Windows Phone Toolkit TimePicker control here.)
From reading the source code of the DateTimePickerBase, it would seem not. Opening the picker page is done by the OpenPickerPage() method, which is private, and is only called from the OnDateButtonClick method, which is also private and handles the Click event on a private Button.
Of course, as the control is open-source, you can take the source code of the control and make your own copy of it with one of these methods exposed. As far as I can tell, it's allowed under the Ms-PL.
So, one of my favorite things about iOS/ObjC in general is the "popover" control.
I am building an app in C# WinForms that would benefit greatly from this type of control- anyone have any ideas on how I might be able to emulate this type of look?
For reference, here's an example screenshot of what I'm talking about http://i.imgur.com/IzbbzrA.png
Thanks for any ideas!
You can create a simple popup control by following the articles linked below
Simple Popup Control
I don't think such a control exists in .Net. What I would do from this point if I were you is try to making one using a customized windows form on top of it. Play with the Mouse Hover events of the control and make the form appear for a short time. Make it without borders. With a little imagination you can have your own version of the PopOver.
I want to make a custom button in shape of a picture with C# for a Windows Store App?
Is there a way to do that from xaml? So far I've made a button and assigned a circle as a background image, but the problem is that even if I click outside the image the button works.
Also I do not believe that Image class has an event for click unfortunately.
I just recently implemented the WinRT XAML toolkit and it works wonder for me. It has an imagebutton control that might do what you want to do. http://winrtxamltoolkit.codeplex.com/
With the help of google: Walkthrough: Create a Button by Using XAML
You should have a look into Expression Blend. You can do all manualy in the XAML-Code but Blend is a huge help if you like to customize your project look and feel. Look at the MSDN-Examples.
I have one textbox in which i just want user to do an manual entry.so i need to disable copy and as-specially paste option which is there in windows phone. is it possible to do it?
This is unfortunaly not possible.
The only solution is to create your own control, with a custom keyboard too.
Regards,
Textbox is not copy-paste-able. You can try using a ReadOnly TextBox as seen here: WP7 CopyPaste on TextBox
.
You could also put it in a WebBrowser control (provided you have enough content and are willing to suffer the display / performance )