How to select a item on rightclick using devexpress ListboxControl

To select a item on rightclick using devexpress ListboxControl you need to use the MouseDown Event.
See the samples below.

Sample C#

private void listBoxControl1_MouseDown(object sender, MouseEventArgs e)
{
	listBoxControl1.SelectedIndex = listBoxControl1.IndexFromPoint(new Point(e.X, e.Y));
}

Sample VB.NET

Private Sub listBoxControl1_MouseDown(sender As Object, e As MouseEventArgs)
	listBoxControl1.SelectedIndex = listBoxControl1.IndexFromPoint(New Point(e.X, e.Y))
End Sub

How to get the selected row index in Devexpress Xtragrid Control using C# and VB.NET

To get the selected row index in Devexpress Xtragrid Control using C# and VB.NET you can use the snippet below.

Samples

Sample C#

Sample VB.NET

Compatibility: working .NET 2.0 working .NET 3.0 not tested .NET 3.5 not working .NET 4.0 not working .NET 4.5not working .NET 4.6

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

How to autosize UILabel to Textsize in IOS using Objective-C

labelTest.text = @"This is my Teststring.This is my Teststring.This is my Teststring.This is my Teststring.This is my Teststring.This is my Teststring.";
labelTest.numberOfLines = 0;
[labelTest sizeToFit];

How to get focusedrow cell value using Devexpress XtraGrid in C# and VB.NET

To get focusedrow cell value using Devexpress XtraGrid in C# and VB.NET you can use one of the following ways.

Samples

Sample C#

Sample VB.NET

 

Compatibility: working .NET 2.0 working .NET 3.0 not tested .NET 3.5 not working .NET 4.0 not working .NET 4.5not working .NET 4.6

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

 

How to set the start location of FolderBrowserDialog in C# and VB.NET

To set the start location of FolderBrowserDialog in C# and VB.NET you can use the following snippet.
To do so, simply set the SelectedPath Value to the path you want.

Sample C#

MyFolderBrowserDialog.SelectedPath = @"C:\Test";

Sample VB.NET

MyFolderBrowserDialog.SelectedPath = "C:\Test"

How to scroll to the end of a TreeView in C# and VB.NET

To scroll to the end of a TreeView in C# and VB.NET you can use the following snippet.

Sample VB.NET / C#

treeView1.Nodes[treeView1.Nodes.Count - 1].EnsureVisible();

How to scroll to the end of a listview in C# and VB.NET

To scroll to the end of a listview in C# and VB.NET you can use the following snippet.

Sample C# / VB.NET

listView1.EnsureVisible(listView1.Items.Count - 1);

How to make a seperator line in C# and VB.NET

To make a seperator line in C# and VB.NET you can use the following snippet.

Sample C# / VB.NET

label1.Height = 2;
label1.AutoSize = false;
label1.BorderStyle = BorderStyle.Fixed3D;

Result:

SeperatorLine_NET

A Seperator line in .NET