Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - ScrollViewer breaks my WrapPanel

 
 
Old 03-19-2007   #1 (permalink)
steve


 
 

ScrollViewer breaks my WrapPanel

Does anybody have any idea why, when I put a ScrollViewer around a
WrapPanel, any buttons contained within the WrapPanel can no longer raise a
Click Event?

What do I need to do to allow the buttons within the WrapPanel to continue
to recognise when they have been clicked?

Thanks

SteveB



My System SpecsSystem Spec
Old 03-23-2007   #2 (permalink)
WPCoder


 
 

Re: ScrollViewer breaks my WrapPanel

Is there any other information you can provide, as that scenario should work
without issue. My quick test works as expected:

<ScrollViewer Margin="20.013,19,36,29">
<WrapPanel>
<Button x:Name="btnClickMe" Content="Click me!"
Click="btnClickMe_Click"/>
<Button Content="Button"/>
<Button Content="Button"/>
<Button Content="Button"/>
</WrapPanel>
</ScrollViewer>

private void btnClickMe_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("I was clicked!");
}

The MessageBox was displayed when I clicked the first button.

--Aaron

http://www.wiredprairie.us/journal



"steve" <steve@home.com> wrote in message
news:%23q9$2hkaHHA.3584@TK2MSFTNGP02.phx.gbl...
> Does anybody have any idea why, when I put a ScrollViewer around a
> WrapPanel, any buttons contained within the WrapPanel can no longer raise
> a Click Event?
>
> What do I need to do to allow the buttons within the WrapPanel to continue
> to recognise when they have been clicked?
>
> Thanks
>
> SteveB
>


My System SpecsSystem Spec
Old 03-28-2007   #3 (permalink)
steve


 
 

Re: ScrollViewer breaks my WrapPanel

I tried creating a simple test app and I had no problems but in my real app
that contains a lot more code it doesn't work. No idea why. Looks like I'll
have to build that particular page from scratch and see what happens

SteveB

"WPCoder" <coder_antispam@wiredprairie.us> wrote in message
news:uNk6i8VbHHA.4000@TK2MSFTNGP02.phx.gbl...
> Is there any other information you can provide, as that scenario should
> work without issue. My quick test works as expected:
>
> <ScrollViewer Margin="20.013,19,36,29">
> <WrapPanel>
> <Button x:Name="btnClickMe" Content="Click me!"
> Click="btnClickMe_Click"/>
> <Button Content="Button"/>
> <Button Content="Button"/>
> <Button Content="Button"/>
> </WrapPanel>
> </ScrollViewer>
>
> private void btnClickMe_Click(object sender, RoutedEventArgs e)
> {
> MessageBox.Show("I was clicked!");
> }
>
> The MessageBox was displayed when I clicked the first button.
>
> --Aaron
>
> http://www.wiredprairie.us/journal
>
>
>
> "steve" <steve@home.com> wrote in message
> news:%23q9$2hkaHHA.3584@TK2MSFTNGP02.phx.gbl...
>> Does anybody have any idea why, when I put a ScrollViewer around a
>> WrapPanel, any buttons contained within the WrapPanel can no longer raise
>> a Click Event?
>>
>> What do I need to do to allow the buttons within the WrapPanel to
>> continue to recognise when they have been clicked?
>>
>> Thanks
>>
>> SteveB
>>

>



My System SpecsSystem Spec
Old 04-06-2007   #4 (permalink)
Isaac


 
 

subject

I believe your Scrollviewer is being created last so it is in front of your Wrap Panel... Create the Scrollviewer first and then the rest and see if that works, if you're using blend right click the Scrollviewer then >Order>Send to back.

You are vague on the information. But this may or may not help I'm not sure what the problem is.

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
My wireless breaks down every 30 min Network & Sharing
Vista SP1 breaks VPN Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46