views:

22

answers:

2

In Psychology, Visual Analogue Scales (VASs) are commonly used to collect subjective responses without overtly quantifying them. They don't have gradations; just end-points. The participant is asked to click a point on the line and the distance from the end is taken to be their response. In some cases, the location on the line is illustrated with a small 'tick' in the form of a perpendicular line, so that the participant may refine their choice before submitting it.

A VAS for pain

I'm building an experiment in C# and Windows Forms. As a lazy approach, I've used a horizontal scoll bar. This clearly isn't good enough though, so I was wondering what approach people would suggest I take.

A: 

Have you considered the Trackbar?

http://msdn.microsoft.com/en-us/library/system.windows.forms.trackbar.aspx

asawyer
I hadn't, but it seems promising. Still has some issues though: 1) The indicator shouldn't be visible at the beginning and 2) I can't get the gradations to go away. Looks like a better fit than Hscroll though.
Tom Wright
You can set the TrackStyle to None which will remove the ticks.
sixlettervariables
Although a general issue with the TrackBar is that it will not jump right to where the user clicks.
sixlettervariables
It will if you set the ticks to a fine enough grade. Or at least it will be pretty close.
asawyer
Just saw your answer, seems I misread your comment sorry you are correct.
asawyer
+1  A: 

@asawyer's TrackBar solution is somewhat problematic without some extra code, because the control itself jumps LargeChange in the direction of your cursor when you click, so no matter what you set it to, it will never jump to exactly where the user clicked, which is important in a VAS.

For those not familiar with the Visual Analogue Scale, it is generally graded as a point between 0 and 100mm along a horizontal or vertical line.

A decent first cut approach is a TrackBar with a min of 0, max of 100, and a frequency of 1, small/large change of 1, with something like:

this.trackBar1.MouseDown += trackBar1_MouseDown;

// ...

void trackBar1_MouseDown(object sender, MouseEventArgs e)
{
    double leftDelta = e.Location.X - this.trackBar1.Location.X;
    this.trackBar1.Value = (int)(leftDelta / this.trackBar1.Size.Width * 100);
}

You'll probably want to take into account the little gutters on either side of the track bar to make this more exact, but this will get you on your feet. You could include buttons above the TrackBar with the Wong-Baker faces for pediatric patients, the buttons could set the value to various presets.

sixlettervariables
This is great and gets me a whole lot closer. The last thing I want to be able to do is to hide the position indicator until after the first click. Any chance you know how to do that?
Tom Wright
@Tom Wright: you will likely have to override the painting of the control. Which at that point I would say go ahead and make your own control to get around those sorts of problems. Another improvement is you can set the trackbar's Cursor to Cross.
sixlettervariables
Suppose you finally make the thumb visible only on first click what if someone wants to skip the question and undo the choice made?
Dialecticus
@Dialecticus: I see the problem, but since no location can be considered a non-answer, you'd want a reset button anyway. In this case the appearance of a thumb signifies that a value will be submitted. In my situation however, this is academic as the choice will be forced.
Tom Wright