Click here to Skip to main content
15,891,431 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB Linq, got 1 duplicate in a GroupBy Call Pin
Richard Deeming17-Oct-17 2:08
mveRichard Deeming17-Oct-17 2:08 
GeneralRe: VB Linq, got 1 duplicate in a GroupBy Call Pin
jkirkerx17-Oct-17 6:28
professionaljkirkerx17-Oct-17 6:28 
AnswerRe: VB Linq, got 1 duplicate in a GroupBy Call Pin
Eddy Vluggen17-Oct-17 2:09
professionalEddy Vluggen17-Oct-17 2:09 
GeneralRe: VB Linq, got 1 duplicate in a GroupBy Call Pin
jkirkerx17-Oct-17 6:24
professionaljkirkerx17-Oct-17 6:24 
QuestionReading complex JSON objects with Newtonsoft Pin
A_Griffin15-Oct-17 1:32
A_Griffin15-Oct-17 1:32 
AnswerRe: Reading complex JSON objects with Newtonsoft Pin
A_Griffin16-Oct-17 23:36
A_Griffin16-Oct-17 23:36 
QuestionCompletely disabling Scrolling in a DataGridView Pin
Peter R. Fletcher14-Oct-17 10:57
Peter R. Fletcher14-Oct-17 10:57 
AnswerRe: Completely disabling Scrolling in a DataGridView - SOLVED Pin
Peter R. Fletcher16-Oct-17 11:29
Peter R. Fletcher16-Oct-17 11:29 
After spending a lot of time researching this, I was able to come up with a solution which works, but there should be an easier way! There are a lot of 'gotchas', apparently 'baked in' to the design of the control. Not only does the view scroll up (by default) when you arrow down into a cell in the last row, but it also scrolls up if you arrow left or right while in the last row.

Implementing my solution involves a number of steps:
1) Subclass the DataGridView control so that you can (optionally) override its ProcessCmdKey method to disable special handling of the arrow keys (you don't actually need to mess with the up arrow key, but I found it easier to disable all of them.
2) Substitute references to your new MyDataGridView control for those to the original version in the containing Form's Designer.vb file - for me, using VS 2013, two references needed to be changed for each affected control. Then, either in the designer or in initialization code, set the option to disable the arrow keys for the modified controls.
3) Write code for the KeyUp and KeyDown Events for each affected control - the KeyDown code does apparently need to be there, but it only has to set the Handled event argument to True; the KeyUp code has to do the work of changing the current cell appropriately for the arrow key pressed. For any arrow keystroke that results in a move to a cell in the bottom row (including a lateral one), the KeyUp code also has to set the control's FirstDisplayedScrollingRowIndex Property to 0 after implementing the move. This is what scrolls the view back down again to abolish the empty row, but it does cause a visible 'glitch'.
4) If you don't want the view to appear to 'glitch' when the user is moving to or on the bottom row, it is best to surround the working KeyUp code with calls to disable and re-enable screen painting while it is (in effect) moving the focus about.
QuestionHow do I change XML-driven menu strip's font? Vb.net Pin
Member 1338609314-Oct-17 4:18
Member 1338609314-Oct-17 4:18 
AnswerRe: How do I change XML-driven menu strip's font? Vb.net Pin
Richard MacCutchan14-Oct-17 6:48
mveRichard MacCutchan14-Oct-17 6:48 
QuestionChange the format Pin
Felix Holzinger7-Oct-17 11:51
Felix Holzinger7-Oct-17 11:51 
AnswerRe: Change the format Pin
Richard MacCutchan10-Oct-17 21:04
mveRichard MacCutchan10-Oct-17 21:04 
Questionsoftwares for agriculture irrigation with the help of visual basic Pin
Member 134513307-Oct-17 4:49
Member 134513307-Oct-17 4:49 
AnswerRe: softwares for agriculture irrigation with the help of visual basic Pin
OriginalGriff7-Oct-17 4:50
mveOriginalGriff7-Oct-17 4:50 
AnswerRe: softwares for agriculture irrigation with the help of visual basic Pin
Mycroft Holmes7-Oct-17 15:15
professionalMycroft Holmes7-Oct-17 15:15 
Questionsoftwares for agriculture irrigation with the help of visual basic Pin
Member 134513307-Oct-17 4:06
Member 134513307-Oct-17 4:06 
AnswerRe: softwares for agriculture irrigation with the help of visual basic Pin
OriginalGriff7-Oct-17 4:50
mveOriginalGriff7-Oct-17 4:50 
QuestionDataGridView with Two Datatables and Combobox Lookup Pin
billsut4-Oct-17 2:19
billsut4-Oct-17 2:19 
AnswerRe: DataGridView with Two Datatables and Combobox Lookup Pin
Mycroft Holmes4-Oct-17 13:30
professionalMycroft Holmes4-Oct-17 13:30 
QuestionResizing images Pin
A_Griffin3-Oct-17 2:03
A_Griffin3-Oct-17 2:03 
AnswerRe: Resizing images Pin
Richard MacCutchan3-Oct-17 6:31
mveRichard MacCutchan3-Oct-17 6:31 
GeneralRe: Resizing images Pin
A_Griffin3-Oct-17 8:14
A_Griffin3-Oct-17 8:14 
Questiondatabase design for financial accounting Pin
Mohammad Kamil1-Oct-17 8:47
Mohammad Kamil1-Oct-17 8:47 
AnswerRe: database design for financial accounting Pin
Mycroft Holmes1-Oct-17 13:28
professionalMycroft Holmes1-Oct-17 13:28 
QuestionRetrieve data from Acess database after login form Pin
Charles9730-Sep-17 4:48
Charles9730-Sep-17 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.