MSFlexGrid - Anyway To Stop Scrolling When Dragging?
Hi...
I've attempted several things to try and prevent the grid display from scrolling when I'm dragging (manual dragmode)..but nothing seems to work. Anyone knows of a way to do this?
Francis
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dragging And Scrolling
I've seen a lot of samples here regarding the scrolling of items that are in a fixed position relative to each other. I was wondering if anyone has any code samples for implementing a combination of dragging items and scrolling.
Thanks
Stop The Dragging...?
Here's what I have:
- A label control array within a picturebox. The label control array
- can be dragged left and right from one end of the picturebox
- to the other. The problem is that the control array can also
- be dragged past either end of the picturebox, making the label
- control array not usable.
Here's what I need:
- To be able to have the label control array stop from being
- dragged. In other words, have a left and right limit as to how
- far the control array can be dragged.
The way I'm doing it now.....doesn't work.
Any ideas welcome...
Stop Form From Dragging Off-Screen
I've searched this quite a bit and keep coming up with the same results... all of which don't really solve the problem...
I have a form that I want users to drag, however, I do not want the form to cross the edges of the screen. That is, I do not want any part of the form to disappear outside the screen. The only code I've found close to this is one to snap the form to the edge of the screen (while still allowing it to be pushed outside the screen).
I've tried using the mouse position API for the form, but it doesn't capture the X and Y coordinates for when you're over the form's border. I understand this to only see the INSIDE of the form, and not the form's border included.
Thanks in advance!
Stop Title Bar Mouse Dragging
Hello Folks,
i am new to this forum but i have a problem which i have researched but failed.
I have disabled my applications titlebar,maximise button. But the title bar actually docks itself in a restored state and yet i wanted it maximised so that no one would drag it over the screen as this happens when its in a restored state.
How can i be able to disable the Mouse Click move titlebar(or application window) action.
Thanks in advance.
Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!
thanks!
Stop Dragging Links From Webbrowser Control
Hi all,
i'm creating a securelink browser application using
WebBrowser cotrol in VB6.
Our requirment is that no one can't do drag and drop
a hyperlink out side the application ,as one can do
with other browsers.
so how can i do this ,plz help me.
Thanks
Reliable Way Of Getting MSFlexgrid Rowdata While Dragging A Row
Hi Guys,
I have an MSFlexgrid in which I can drag a row and drop it in a different row position. I need someone to please check if this code is correct. I know that using the clip method of the grid I can get the data of all the columns like in the code. I have assigned the rowdata property of the row being moved to a variable and then when I drop the row I assign that variable to the new rows rowdata property. Is this correct
Code:
Private Sub CoolFlex1_DragDrop(Source As Control, x As Single, y As Single)
On Error GoTo errh
If Source Is Me.CoolFlex1 Then
Dim strTemp As String
Dim idTemp As Long
With Me.CoolFlex1
'make sure all columns are selected
'required for Clip property
.Col = 0: .Colsel = .Cols - 1
strTemp = .Clip 'save the data in the selected row
idTemp = .RowData(.Row)
.RemoveItem .Row
.AddItem strTemp, .MouseRow '+ 1 'moves row after
.RowData(.MouseRow) = idTemp
'MsgBox strTemp & .MouseRow
End With
End If
Exit Sub
errh:
errmsg "The following Exception occured : " & ERR.Description & ", " & ERR.Source & "", "Exception occured in frmFlex.CoolFlex1_DragDrop()"
End Sub
Stop Scrolling In RTB
Is there any way to stop someone from scrolling a RTB. I know how to turn of the scrollbars but then they can go to the last line and press the down arrow. Also the user must be able to edit the contents of the RTB.
I know I could trap for the arrow keys and enter and backspace but they could still just click and drag their mouse down (or up).
Stop Excel From Scrolling
I was wondering if there was any method to lock a spreadsheet to stop a user from scrolling down or across a worksheet ?
How To Stop A Textbox From Scrolling?
Hi. I have a textbox and it gets a lot of text in it. I want to allow the user to scroll the textbox (which works fine). But, when I add text, the box scrolls - I want it to stay wherever it is.
I've tried adding text using:
text1.text = text1.text & "newstuff" & vbNewLine
When I use the above line, the textbox jumps to the top.
or if I use:
text1.selstart = len(text1.text)
then, it jumps to the bottom.
How can I add text and have it stay where it is? Thoughts?
Stop The Scrolling Text
A simple question, but Now I am confused..
I have a Vertical scrolling text form, on which the text scrolls
I want to stop the scrolling at the particular point for e.g When textbox top is at the middle of picturebox (picturebox1.height /2) the text in textbox gets altered line by line,
Are you getting me??
When the first line of the text reach at the middle of picture box the firstline wil disappear, then the second line reach to middle it also disappear....like that..
I have attached this form with this question.
I try it by editing caption in timer event but it won't work???
Please help???
Gary
Stop FlexGrid From Auto Scrolling To End
When filling a flexgrid with data, if in the end there are more rows or cols than fit on the screen, the grid will be scrolled down to the end.
i want it to view the grid from the beggining (top-left) by default, not the end of the grid.
i tried setting the Grid.ScrollBars property to 0 (none), filling it with data and then changing the .ScrollBars property to 3 (Both), but i still got the same result. I tried the code
FlexGrid1.col = 0
FlexGrid1.row = 0
hoping it would scroll back to the top, but no luck there either.
couldnt find anything in a search so started a new thread.
Combobox, How To Stop Event Firing When Scrolling
Hi Guys,
I am a fairly basic user when it comes to VB6, I have, what is getting to be a rather large project.
I have a Combox box with a large list of entries populated from a text file, then a number of If statement depending on what is selected from the Combobox drop down list. (Style 0)
My problem is when scrolling through the list the If statements are firing when passing certain entries rather than waiting for me to Click on the relevant entry.
Is there any way I can stop this so it only works on a mouse click event, I tried _Change but this did not work either.
Any help would be cool,
Thanks
Problem With Non-stop Scrolling Of The ComboBox Drop-down List
Hi!
I ran into a strange phenomena:
After clicking on either the spin buttons (the small triangles) or the
scroll bar itself of the drop-down list of a combobox, the scrolling
doesn't stop until the list end is reached. The scrolling stops when
the mouse pointer leaves the scroll bar area.
The application receives messages (via the serial port). The module
that handles the received messages is laced with DoEvents. When no
messages are sent to the application (the transmitter is turned off),
the combobox functions properly.
The application is VB6, SP6, under Windows XP, SP1 with 512 MRAM
memory.
Your help will be much appriciated.
Amir
MSFlexgrid And Scrolling
I am loading records manually into a flexgrid and depending on what data the user enters I am selecting the row. This all works good and well.
The problems occurs with selecting the record programatically, because there are so many records being entered there is a scroll bar and the highlighted record is sometimes not actually in focus on the screen.
Is there a way round this?
Thanks,
Andrew
Scrolling In MsFlexGrid
Hi Everybody,
i would like to use a FlexGrid WITHOUT Scrollbar, but I want to scroll.
If i use the scrollbar, iīm able to have the last entry in the Grid visible at the bottom of the (small) Grid using ...TopRow= ...Rows - 10
If i switch of the scrollbars (i donīt need and want them) itīs not working.
Any ideas ???
Thanx
Yoki
MSFlexGrid Scrolling
My problem is the scrolling, I can add this VScroll1 to the code and I can somewhat scroll, but it is real buggy. If I take it away and use the FlexGrid control to scroll it jumps and never scrolls. Is there a better way to get all of my data in the Grid and scroll it normally, one at a time? or unless I click in the track it goes down 20 o so? Right now it works with VScroll1 but as I said it is real buggy, it never stays in position after the scroll. I can sroll down, then over to the left and then the vertical scroll is messed up on what data is being shown. Little hard to explain.
So I need to know if there is a better way to scroll and show all of my data?
Here is my code
Code:
Private Sub Form_Load()
Dim Cn As New ADODB.Connection
Set Cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Cn.CursorLocation = adUseClient
'Jet Connection And Recordset
Cn.Open "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" + App.Path + "Software.mdb"
rs.Open "Select * from [MS Office Licenses] order by UserID", Cn, adOpenStatic, adLockOptimistic
'SQL Connection and Recordset
'Cn.Open "PROVIDER=SQLOLEDB;server=YourSQLServer;uid=sa;pwd=;database=pubs;"
'rs.Open "select * from [authors]", Cn, adOpenStatic, adLockOptimistic
CurrentStart = 0
'Set the Scroll bar to be in front of the grid
VScroll1.ZOrder 0
Call WheelHook(Me.hWnd)
End Sub
Sub FillGrid(StartRec As Long, NumRecs As Long)
MSFlexGrid1.Clear
If StartRec <= 1 Then StartRec = 1
Dim MyString As String
Dim X As Long
MSFlexGrid1.Redraw = False
MSFlexGrid1.Visible = False
MSFlexGrid1.Clear
MSFlexGrid1.Rows = 1
MSFlexGrid1.Cols = rs.Fields.Count + 1
'MsgBox MSFlexGrid1.Cols
' Display column headers.
'MSFlexGrid1.Rows = 1
'MSFlexGrid1.Cols = Rs.Fields.Count
ReDim col_wid(0 To rs.Fields.Count - 1)
For c = 0 To rs.Fields.Count - 1
MSFlexGrid1.TextMatrix(0, c) = rs.Fields(c).Name
col_wid(c) = TextWidth(rs.Fields(c).Name)
'MsgBox Rs.Fields(c).Name
Next c
MSFlexGrid1.AddItem ""
For X = StartRec To StartRec + NumRecs
If X < rs.RecordCount - 1 Then
rs.AbsolutePosition = X
'MyString = "" & Chr(9)
MyString = vbNullString
For J = 0 To rs.Fields.Count - 1
If IsNull(rs(J)) Then
A$ = " "
Else
A$ = rs(J)
End If
MyString = MyString & A$ & Chr(9)
Next J
MSFlexGrid1.AddItem MyString
End If
Next X
MSFlexGrid1.AddItem ""
MSFlexGrid1.Visible = True
JustSet = True
MSFlexGrid1.TopRow = 2
MSFlexGrid1.Redraw = True
' Set the column widths.
For c = 0 To rs.Fields.Count - 1
'MsgBox col_wid(c)
MSFlexGrid1.ColWidth(c) = col_wid(c) + 100
Next c
End Sub
Private Sub Form_Resize()
JustSet = True
'MSFlexGrid1.Top = 30
'MSFlexGrid1.Left = 50
MSFlexGrid1.Visible = True
'MSFlexGrid1.Height = Me.Height - 500
'MSFlexGrid1.Width = Me.Width - 200
MSFlexGrid1.Clear
'MSFlexGrid1.Cols = Rs.Fields.Count + 1
MSFlexGrid1.Rows = 25
MSFlexGrid1.TopRow = 1
X = 1
Do Until X = 25
If MSFlexGrid1.RowIsVisible(X) = False Then
PageSize = X
Exit Do
End If
X = X + 1
Loop
' Use one fixed row and no fixed columns.
'MSFlexGrid1.Rows = 2
'MSFlexGrid1.FixedRows = 1
'MSFlexGrid1.FixedCols = 1
' Display column headers.
MSFlexGrid1.Rows = 1
MSFlexGrid1.Cols = rs.Fields.Count
ReDim col_wid(0 To rs.Fields.Count - 1)
For c = 0 To rs.Fields.Count - 1
MSFlexGrid1.TextMatrix(0, c) = rs.Fields(c).Name
col_wid(c) = TextWidth(rs.Fields(c).Name)
Next c
'MSFlexGrid1.Rows = 1
'MSFlexGrid1.Cols = 1
RecPages = (rs.RecordCount / PageSize) - 1
VScroll1.Max = RecPages
VScroll1.Min = 0
FillGrid CurrentStart, PageSize
VScroll1.Top = MSFlexGrid1.Top + 45
VScroll1.Left = (MSFlexGrid1.Width - VScroll1.Width) + 320
MSFlexGrid1.LeftCol = 1
If MSFlexGrid1.ColWidth(rs.Fields.Count) + MSFlexGrid1.ColPos(rs.Fields.Count) > MSFlexGrid1.Width Then
TempVAr = MSFlexGrid1.RowHeight(1)
Else
TempVAr = 0
End If
VScroll1.Height = (((PageSize + 1) * MSFlexGrid1.RowHeight(1)) + ((MSFlexGrid1.Height - 60) - (PageSize + 1) _
* MSFlexGrid1.RowHeight(1))) - TempVAr
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call WheelUnHook(Me.hWnd)
Dim i As Integer
'close all sub forms
For i = Forms.Count - 1 To 1 Step -1
Unload Forms(i)
Next
End Sub
Private Sub mnuAddPO_Click()
fvEdit = False
FrmNewPO.Show
End Sub
Private Sub MSFlexGrid1_Scroll()
If JustSet = True Then JustSet = False: Exit Sub
If MSFlexGrid1.Row >= MSFlexGrid1.Rows - 3 Then
CurrentStart = CurrentStart + 1
If CurrentStart > rs.RecordCount - 1 Then CurrentStart = rs.RecordCount - 1
FillGrid CurrentStart, PageSize
MSFlexGrid1.SetFocus
MSFlexGrid1.Row = MSFlexGrid1.Rows - 3
If (VScroll1.Value + 1) * PageSize < CurrentStart Then VScroll1.Value = VScroll1.Value + 1
Exit Sub
End If
If MSFlexGrid1.Row <= 2 Then
CurrentStart = CurrentStart - 1
If CurrentStart < 1 Then CurrentStart = 1
FillGrid CurrentStart, PageSize
MSFlexGrid1.SetFocus
MSFlexGrid1.Row = 3
MSFlexGrid1.Row = 2
If VScroll1.Value - 1 > 0 Then VScroll1.Value = VScroll1.Value - 1
Exit Sub
End If
Call FillGrid(CurrentStart, PageSize)
MSFlexGrid1.SetFocus
End Sub
Private Sub VScroll1_Change()
If VScroll1.Value * PageSize >= CurrentStart Then
CurrentStart = CurrentStart + (PageSize)
Else
CurrentStart = CurrentStart - (PageSize)
End If
If CurrentStart < 1 Then CurrentStart = 1
FillGrid CurrentStart, PageSize
End Sub
' Here you can add scrolling support to controls that don't normally respond
Public Sub MouseWheel(ByVal MouseKeys As Long, ByVal Rotation As Long, ByVal Xpos As Long, ByVal Ypos As Long)
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is MSFlexGrid Then
If IsOver(ctl.hWnd, Xpos, Ypos) Then FlexGridScroll ctl, MouseKeys, Rotation, Xpos, Ypos
End If
Next ctl
End Sub
MSFlexGrid Scrolling
I have a MSFlexGrid that can be scroll to the right to view more column data.
My questions are:
1- How can I automatically force the grid to go back to the beginning column once the user scrolls and the grid displays the last column?
2- How do you force the grid to display from a specifis column number ?(i.e. from column 5 or from column 5 to 13)
Thanks
Scrolling A MSFlexGrid
I'd like to scroll a MSFlexGrid using PageUp/PageDown keys but without changing the current cell.
Any ideas!
My grid has rows of different height, so I do not know ahead of time how many rows I have on a page (visible area of the grid), and also the grid resizes in sync with the form.
Thanks,
Sorin
MsFlexGrid Scrolling Problem
The user constantly fills the MSFlexGrid and once it fill like 20 rows it starts to go below the line and a scroll bar appears. Is there anyway I can set the scrollbar value? Is there anyway I can get it to follow without adding new entries to the top?
MSFlexGrid Scrolling Problem
I have a funny feeling there will be a simple answer to this, but... I have a MSFlexGrid with the Enabled property set to False, because I only want the user to see the data, not to edit it. There are several columns that are not visible, and the horizontal scrollbar does appear, but when you click on the scrollbar it doesn't scroll! It doesn't do anything! Is there a way to make the scrollbar work while keeping the MSFlexGrid disabled?
Thank you!!
*****
EDIT: Just in case you were curious... I discovered that the frame the MSFlexGrid is in was disabled. When I enabled the frame, the scrolling worked, even though the MSFlexGrid was disabled.
Scrolling MSflexgrid Without Using Scroll Bar
Hi everyone,
I am using a flexgrid and wish to jump to a particular cell and have it centered on the screen, so the user does not have to manually go there with the scroll bar. There is probably a simple way to do it which i have overlooked but its doing my head in. Please could someone tell me how to do it?
Thanks alot
MSFlexGrid Scrolling Issue
Hello there -
I've got a flexgrid in a relatively small area of my form. The height of each row varies depending on content (a particular column is storing user notes, which may be just a couple of words or could be several paragraphs). In the case where there is a lot of verbiage, the row in question is larger than the area for the flexgrid, thus requiring the user to scroll (vertically). However, when the vert scrollbar is moved, the flexgrid just shows the next row as the top row - i.e., it will not show the remaining content of the too-high row.
A search of the forum and other places suggest that setting ScrollTrack = True should fix the problem, but it does not - there is no change in the behavior I described.
Anything else I can try?
MSFlexGrid: Scrolling With Code
I am programming a Find procedure inside of a MSFlexGrid and the main problem I found is that if you find a Col or a Row that isn't shown due to the scrolling, the control won't scroll automatically to show that position and the user must scroll manually to it.
I tried to scroll the MSFlexGrid using code but I haven't found a way to do it. So I wonder if there is even a way to achieve this. Please help me!
I attach the pictures of what happens currently.
MSFlexGrid Scrolling Problem
I have a funny feeling there will be a simple answer to this, but... I have a MSFlexGrid with the Enabled property set to False, because I only want the user to see the data, not to edit it. There are several columns that are not visible, and the horizontal scrollbar does appear, but when you click on the scrollbar it doesn't scroll! It doesn't do anything! Is there a way to make the scrollbar work while keeping the MSFlexGrid disabled?
Thank you!!
Scrolling Thr. MSFlexgrid(RESOLVED)
Hi all,
i have a form which has a textbox and a msflexgrid.grid has some 200 names. when i type in the text box any name matching in the GRID is selected. But my problem is i m not able to see the name in the Grid selected. screen shot in zip file
what i need to scroll the grid when any name is found.
MSFlexgrid Scrolling Problem
I have a flexgrid that is of a fixed height. If I have a cell that does not finish at the bottom of the flexgrid, when the user scrolls down, the next cell down jumps to the top of the flexgrid. This means that it is impossible to see any data in the bottom of the cell that goes off the bottom the grid. The heights and number of cells vary depending on the data.
Is there a way of stopping this.
Thanks
Rob
Problem While Scrolling The MSFLEXGRID
Scroll MSFLEXGRID
Quote:Urgent Help Needed
I have been trying to develop an editable flexgrid.My Problem started When I tried scrolling records using scroll bar.This problem is seen when the textbox is visible inside the flex.
Now My Problem is: I am using Up and down arrow to move the textbox up and down along the first column only. It's movement can be restricted well while using Up and Down Key. But if the scroll bar is used the textbox goes beyond the total no of rows. If I am keeping textbox visiblity as false in the scroll event of the Flex grid then then textbox keydown event shows error.
More over I would Like to know how to control the scroll action when Clicking the upd scroll Button and Down scroll button.
Plz see the image attached to clarification and Kindly advice.????????????????????????????????????????????????????????????
Santhosh
Edited by - santhosh_176 on 8/8/2004 5:51:51 AM
MSFlexGrid: Keeping Track Of Scrolling
I want to freeze the first column of a MSFlexGrid only when I scroll to the right (when there is no scrolling I want to be able to edit the first column).
How can I be aware whether there is some scrolling or not, so as to be able to change the FixCols property whenever it's necessary?
Thaks a lot,
rr.
Auto Panning(Scrolling) In MSFlexGrid
I want to make my flex auto scroll vertically and horizontally. Whenever I insert new row in a flex cursor goes to the new line but I have to scroll down manually to the new line. The same way, I want my flex to make move to Right and Left side.
I used SendKeys "{Down}" and everything but It couldn't work,
Pleez anybody help me out
Stop Error? Or I Will Stop You!
Oh the title i just wanted to get your attention. it looks like it worked though.
So now to the real problem, How do you make an easy error handler for a for next loop that sets or reads the properties of controls. and it tries to read a "timer.width".
I don't want ot know a way to avoid the error just a way to handle it.
Regards
E.P.
Dragging Help
i need to kno how to make a form so when you draag it to within 120 of the left of a screeen it sticks there, and is able to be dragged away again, like winamp can do. any help appreciated.
thank you.
ollie.
Dragging .. Please Help
Hello,
im trying to make an audio player... there is a play list (list box)... and i want it that, when the program is open, you can drag a song icon (lets say from the desktop) onto the listbox and the file name is displayed there..
can anyone please help?
Thanks!
l8er
Dragging
ok, I know what picture.drag 1 and picture.drag 2 is, but how do I conbine them to make a drag and drop thing? all I want to be able to do is drag a picturebox around the place, but how?
Dragging What?
How can I know which object is being dragged?
If I use DragMode: automatic, seems the GotFocus is not working.
What I try to do is like VB IDE, drag an object and put into another container.
Besides, I also need to draw the 6 small squares to allow user to resize.
I tried to use DragMode:Manual, but then for ComboBox, I cannot trap mouseevent like MouseDown etc !!
Any solutions???
Thanks
Dragging
I want to drag a button from one area of a form to another. I suppose this requires a calculation of the cursor position, and then some code for the Form object. But I cannot find out a way to do this seemingly obvious task. I know to set drag property of my button to "1", but beyond that it is a mystery to me.
Dragging
How can i make a object move like drag it to another spot ?
Dragging
Is there a way to drag a path from Window Explorer on to a textbox?
Dragging Help
I'm having a problem with the following code and I need a tip or workaround:
Dim OldX As Single
Dim OldY As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - OldX
Source.Top = Y - OldY
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
OldX = X
OldY = Y
Picture1.Drag
End If
The problem is the x,y of the form is not realized unless the cursor leaves the original plane of the picturebox. In other words if you put the cursor in the middle of a picbox that is 1000 whatevers wide by 1000 whatevers high you can't move the picture box 499 or less whatevers. Any help?
Thanks,
Joey O
Dragging
When I click on my label, the drag box comes up but when I release it the label stays in the original place, help !
Dragging A SSTab Outside Of An App.
Hello and Good day to all. Thanks for any replies to this post!
I was wondering if it is possible to enable a drag and drop method for an sstab. What i would like it to do (the app) is allow users to drag 1 of the sstabs outside of the program area and once the mouse is release, the window will act as its own independent form. For example:
__Tab1____Tab2____Tab3__
When the user clicks and Drags Tab1, they drag it outside of the main form..(so the mouse if over the desktop for example). When they release the mouse button Tab1 becomes its own form, and is independent of the main form. So if the original was closed, Tab1 would not be.
Like so:
__Tab1__________________
And this is to apply to each SSTAB.
Not sure how one would go about accomplishing this.
Any comments or suggestions would be appreciated.
Thanks again for view and/or replying to this post.
Much appreciated!
Dragging Labels Around..
Say I have a few "columns" just seperated by simple lines, with a bunch of labels in each "column", how would I go about being able to drag labels between and within columns?
Dragging A Polygon
Dear list
I have made some shapes using the polygon api and filled them with colour. Currently I can identify when the mouse is over the polygon using point(X,Y). From this I am able to drag the polygon across the screen by continually using CLS and remaking the polygon at the current mouse point. This is understandably flickery and depending on tyhe speed of the PC - can be quite slow. Has anyone got a suggestion how I could drag the polygons better. Note they cannot be placed inside another control!
any ideas would be much appreciated.
Thanks
Optom
Dragging A Polygon
I have created a polygon using the polygon function in the API. Is there any way I can drag it with the mouse as if it were an object?
Thanks
optom
Dragging An Image Over Another One
While I'm dragging an image over another one, the one under is being refreshed, which makes the movement unclear. How to get rid of this?
|