Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4051872
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:14:57+00:00 2026-05-20T14:14:57+00:00

I just wasted my entire evening on something which I thought would be very

  • 0

I just wasted my entire evening on something which I thought would be very simple but it seems WPF and Google are letting me down completely.

I need a grid, 6×6 of which I fill every row and column with a custom control. I want to be able to navigate through this grid via the keyboard (I can get those events, no problem) but I cannot seem to find how I can always have the selected grid row/column in the center of my window.

I found some carousel alike implementations, but most of them only work in a single direction and I want two way navigation, yet none seem to support this nor can I extend them to do this.

I essentially want to create a PSP alike grid navigation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:14:57+00:00Added an answer on May 20, 2026 at 2:14 pm

    One easy way is to do this:

    • Create a scrollable form.
    • Add a 6×6 grid of child controls.
    • In the GotFocus (or similar) event for all the controls, set the parent form scroll offset to an appropriate position to centre the child.

    This is pretty straight-forward thing to implement, with a little bit of maths to work out how to centre the x,y position of a control by setting the scroll offsets (it can be tricky/confusing, but as long as you understand the coordinate systems used for scrolling, not too bad)

    Or, another approach that avoids scrolling via the windows APIs and using custom controls:

    • Create a form
    • Override OnPaint to draw your grid of 6×6 “controls” as simple graphical shapes or bitmap images centred on the selected “control”.
    • Handle keyboard (KeyDown/Up) and mouse handling (MouseDown/Up) events to make the 36 areas of the graphic respond to user inputs in the way you desire. You’ll have to track the selected item and force the window to redraw its graphics to show the new state. Enable double buffering to stop it flickering.

    The first approach gives you a lot of windows-based handling for free (tabbing between controls, remembering where the input focus is, and directing events to separate classes for each “control”, for example). The second approach strips away all this “help” but gives you complete control over everything, which can often help avoid unintended behaviours (e.g. it won’t move the input focus when the user presses Tab unless you specifically write the code to make it do that).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just wasted a day trying to find the answer on my own. I
Just wanted to know how i would replace sitename.com with sitename2.com whenever a user
Just wanted to know something about signed vs unsigned interpretation. Am I right if
Just wanted to know if overriding UITabBarController would get my app rejected? Is it
I have wasted an entire day trying to fix problems with my pages. After
Years ago I created a tiny, simple SWF just to play MP3 files on
I just wasted invested a good chunk of time trying to determine why a
I wanted to know which one of these would be more time-efficient when implementing
So this is just a thought... Say I wanted to insert a line into
I understand you can specify a landscape, for the entire application but what if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.