Display both options of ToggleButton in WPF as links with custom styles - c#

I am trying to display two links namely "Entire Content" and "Summary" on a page. I wish to use a ToggleButton so that the relevant information can be displayed by switching between the two options.
However, I wish to display the toggle button options such that both the links are visible at all times and the one which is selected should be highlighted (probably styled with a bold, italic or underline), just to let the user know the currently displayed content.
What would be a good way to achieve this?

How about using two grouped radio buttons styled to look like toggle buttons.

Related

Modifying DevExpress GridControl expand button

I am new to DevExpress and I couldn't find a solution to modify the plus sign on nested gridviews.
Since some of my users have tablets they want to expand rows by touching the plus sign. However they are having hard times to touch exactly on the plus sign.
Is there any way to modify it to make it larger?
Changing size of the sign or changing the image completely is pretty fine for me.
Your ideas are welcome.
I suggest you to go through below reference links, These will provide you more details regarding your desired functionality:
To modifying Group Expand Button:
How to display an image in a group row
GridView.CustomDrawGroupRow Event
How to get skin's '+' icon for Custom Draw Group Rows
In case of Mater-Details:
For increasing the size of the Expand/collapse button:
Enlarge Exapnd/Collapse button of master detail view in xtragrid
master detail expand button size
If you want to change GridView's expand\collapse icon then you can
change it by modifying an image of the Grid | PlusMinusEx skin
element. Here is a code snippet illustrating how to replace the image
with your custom one in a currently applied skin.
Skin skin = GridSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Default);
SkinElement element = skin[GridSkins.SkinPlusMinusEx];
element.Image.SetImage(GetNewImage(), Color.Magenta);
LookAndFeelHelper.ForceDefaultLookAndFeelChanged();
You can also paint the expand/collapse button on the CustomDrawCell
event handler. Please see the How to paint the master row's expand
buttons within the CustomDrawCell event in exactly the same manner
as the XtraGrid does KB article for more information.
References:
Draw custom expand/collapse button in GridView Row
Custom Draw +/- button for Master Detail GridView
Grid - How to change the master-detail expand button
XtraGrid:Adding a button to a cell that will allow cell data to expand - collapse.
Alternatively, you could use the TouchUIMode feature which make thing bigger and easier to use in a touch enabled environment. See this page :
https://documentation.devexpress.com/#WindowsForms/DevExpressXtraEditorsWindowsFormsSettings_TouchUIModetopic
Edit : there is also a touch optimized skin which you can see in this blog post :
https://community.devexpress.com/blogs/theonewith/archive/2011/12/29/build-for-beautiful-with-dxv2-metro-inspired-winforms-apps.aspx

WPF textblock which allows the selection of text

I have a TextBlock in my app that has text with some URLs in it. At the same time, I want the text to be selectable and copyable. If I use the TextBox element I loose the ability to add Hyperlinks and if I use the TextBlock I loose the selection functionality.
Having all that said, what do you suggest to keep both the hyperlinks and the select (with mouse and keyboard) ability?
Edit: this application is a chat app, and I want the incoming message to be selectable while the URL are clickable.
Not sure but perhaps you can use RichTextBox. See: Adding hyperlink in textbox.
You will have to manage to find links when the user type one and modify the text in accordance (inserting an hyperlink) with the user text. Or add a way, like a ContextualMenu, to offer the user to add an hyperlink.
I'm not sure you can find a control that do exactly what you want. Good luck!
The Webbrowser control will allow text selection and hyperlinks.
You can do something like this:
<Label>
<Hyperlink NavigateUri="bob#contoso.com">
<Run Text="bob#contoso.com"/>
</Hyperlink>
</Label>
You can style appropriately and add commands to Hyperlink if you want to actually navigate to that link when clicked

Is there another way to browse user controls in C#

I am new to C# and I am using windows forms.
I don't know if the term "browse" is right to use in this case or not.
I have Form1 with 3 buttons ( buttonA , buttonB and buttonc) in it.
I linked buttonA with a user control which contains 20 buttons and each one of those 20 buttons is linked to a user control which contains 10 buttons each of which does an action which it is clicked, also same thing applies to buttonB and buttonC . Now I configured user controls visibility when button clicked . For example:
Click buttonA user control1 with 20 buttons show up, click one of those 20 buttons another user control show up with 10 buttons.
What I am trying to do is something like browsing windows folders but in this way I will end up having too many user controls and it is confusing and I feel this is not the correct way of doing it. Can anyone please help me if there is another way to do taht? Thank you
What I am trying to do is: I click on
Your scenario seems to be ideal to use TreeView control. This controls displays a hierarchy of items, in your case a hierarchy of products and subprodcuts. A user of your application will be able to expand/collapse nodes as he/she want just by clicking a node. It is much more intuitive and readable than pressing buttons.
For example you can easily achieve the following icons:
You can also associate icons with nodes, change their background or foreground etc.
I think ListView control may fit your needs. It can display a lot of items in different forms (for your task consider using View.LargeIcon or View.Tile for ListView.View property). It also supports groups that may be useful for building POS system.

CutstomControl Selectable MultilineTextBox

I will have to create a Control that supports multiline-copy of text. It looks like this:
Label1: ContentLine1 Label2: ContentLine2 (right aligned)
Blah: ContentLine2 Hyperlink
Label3: ContentLine 3 (needs to collapse if no extended info available)
Problems: Mixed styles (bold labels, regular content and hyperlink)
I tried using RTF + FlowDoc with tables. I ultimately gave up after many problems (like no autosizing columns in flowdoc) at the hyperlink I could not get to work. I works in normal mode though. Also the visibility thing is complicated in flowdoc. I had to add and remove the last row when I only wanted to hide it.
I am currently thinking about building a customcontrol giving me the selection like in a WORD-Table. You can start in the left upper cell and just roll down to the right side or just select a part.
Things I also tried so far: A stylized DataGrid: worked good for Layout, but copying did not work as expexted.
Single TextBoxes stlyed as labels... doesn't work for more than one at a time.
Does anybody know I can mimic the textbox selection behaviour over multiple controls, like using mousemove / events to do the magic?
Thanks in advance! :)

C# win form custom control - disable selection box, and use font color for selection indicator

I have a custom control based on the label control. My question is how I disable the selection box around this custom control when a user selects it while in design mode.
I would like to just change the font color when selected, and then change it back when unselected.
The reason for this is because when you have many labels with small font very close together it makes it hard to see the other labels when you select one of them and the selection box from the one selected obscures the user from seen the other labels that are very close to the one selected.
You cannot prevent it from being selectable at design time. It is considered a component of the form and you will always be able to select it in order to be able to delete it or modify its properties by selecting it.

Categories

Resources