Control The Position Of Components Depending On Others
I was wondering if it's possible to place components on a form
depending on the size of another component.
Let's say I have a datagrid that gets populated from a database.
Depending on the choices of the user, that qill create a query, and
depending on that query, the datagrid might have 10 rows or it might
only have 1. I want to place a radiobuttonlist as well as a label just
beneath the datagrid, but in the design view, I place it right under
the datagrid. And when the datagrid has many rows, my label gets mixed
in the datagrid. Or if it has only one row, the label is way underneath
it....at the bottom.
How can I control the position of components depending on others that
get populated at runtime ?????
I know one of u guys knows this......has to!!
thanks in advance!!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
ActiveX Control Behaves Differently Depending On Server
We have an ActiveX control that is hosted (i.e. the CAB file is stored) on our main production IIS server. This control does some simple MAPI related stuff, i.e. sending emails, and works fine 98% of the time. On occassion, however, we get support calls of the nature that clients using the control can't send emails. This happens only to a select few users.
When testing the application prior to deployment, we would host the control on a development IIS server. We never ran into any email problems or any MAPI related problems when accessing the control on the development server. The problem mentioned above appears only when the control is accessed on the production server, and then only for a handfull of users. As a test, we asked these users to access an identical control on the development server and to see whether the problem went away. To our surprise, these same users had no problems with their emails.
The controls on both servers are identical in all respects, and the MAPI sub-system DLLs that are needed by each client to perform the emailing are identical accross the organization.
Could it be that the ActiveX control is somehow being prevented from executing properly (maybe by the MAPI sub-system) because the control originated from a particular server?
After all, it shouldn't matter which server an ActiveX control is downloaded from... right?
I'm going on pre-conceived notions here, if someone knows more about this, I would really appreciate some advice.
Thanking you in advance.
How Control On Web Components Of ASP In VB6
I am working in a money exchange. I developed a money transfer program for the company.
Now my company has started an online money transfer service up on an agreement with EzRemit service which offers this service.
EzRemit service is done through their e-commercial web site www.ezremit.net.
So in my project I coluld to call this web site using webbrowser control of VB6. Now I want to manipulate programitcally the data we put in the fields of the web site. That is the same data we want to also store in our server while it goes into remote server of the site.
Here an another company who also deals with the EzRemit service has a program with this facility. The site is opened in a VB6 program and this program manipulate and store the data entered in the fields of the web site.
Thus my manager requested me to develop same facility in our program also. And I have no way to contatct with the programmer who did for other company.
So I request you also to help me regarding this by providing idea or code to do the same. I think it is done in VB6 by the help of ASP.
Any way I hope your help urgently
Common Control Components
I was just playing around with the TreeView, and the TabStrip controls and was wondering how to change the title of a tab from insisde the app? And also how do you setup the TreeVIew control?
Office Web Components - Spreadsheet Control
I have a spreadsheet control that I want disabled. To accomplish this, I placed it in a Frame and disabled the frame.
Now I want to enable scrolling. For this, I attempted to create a hot-spot using mouse coordinates and the frame's mousemove event, like so:
private sub frame1_mousemove(parms...)
'if the mouse is over the scrollbar
if coordA < X < coordB AND coordA1 < Y < coordB1 then
frame1.enabled = true
frame1.enabled = false
This appears to "work", but with some strange behavior... when the frame is enabled, it's contents are re-painted. When this happens, the scrollbar, (and ONLY the scrollbar) disappears. Some clicking around brings it back, but this behavior is unacceptable.
Additionally, the mousemove event seems to be somewhat unreliable in that it isn't always recognized... sometimes when I leave the "enable" real estate, the frame remains enabled.
Is there a better way to accomplish what I'm attempting?
Removing A Control From The Components List
Does anyone know how to remove a control from the components list.
I manually browsed for an OCX.... but got runtime errors with it.. so i didnt use it. Now everytime i open VB i get the same errors as the control is still in the list, even the it is not checked or used.
Any ideas how i can get rid of this item. The OCX is located on a network drive, so it now as though i can just delete the file.
Removing ActiveX Control From Components List
I created an ActiveX control and added it to the components list. I deleted the OCX file as it had a bug. I deselect it in the components list. The name however remains in it. How can I remove the name of the control from the components list
Cannot Find Common Dialog Control 6 In The Components...
I need to add the Common Dialog Control to the Toolbox. According to the book's instruction, I selected Project, Components from the VB main menu then check its box, click ok to add. In there, I cannot locate Microsoft Common Dialog Control 6. (went thru it 4 times already). Where could it possibly be? How do I add that to the Toolbox. I use the CD that came with the book to install the VB6 (working model). Any help is greatly appreciated.
Need Control - Dialobj.ocx (or Alt) - Help With USER INTERFACE COMPONENTS
Need Control - Dialobj.ocx (or alt) - help with USER INTERFACE COMPONENTS
I am trying to find a decent dial control, similiar to a slider control but its round and moves 360 degrees. I understand Microsof made a public one but I don't have it, and cant find it on the net. I did find online 'dial.exe' which includes some VB related code, but it doesnt include the needed ocx.
I need to use an OCX or .DLL that will work with VB 4.0
Tried looking at heaps of online sites, downloaded lots of different shareware,trial ware, etc... but couldnt find anything I could really use.
The few shareware, trial ware versions had extremely annoying nag screens and their cost for a simple dial control was way out of bounds.
Sigh... does anyone know how I can get dialobj.ocx or an alternative decent
Im Missing Crystal Report Control From Components Menu!?
It's just not there. I am studying and doing an assignment, and it tells me to use Crystal Report Control 4.6. It has a photo of it listed in the Components list, but it is not on mine. Where'd it go?
Can I download this somewhere and put it in manually? Help!
Control Arrays DO Modify The Behaviour Of Some Components. Here's Proof
Yesterday, I had posted a question as to how can I have multiple option buttons in a frame that default to the "NOT SELECTED" state- for all the buttons.
James Stanich's solution was to put the radio buttons on top of a from, instead of inside the form, then manually handle the mutual-exclusiveness in the event handlers.
This does work, but I would like to better understand the problem.
However, I recently found out that by placing Option Buttons in a control array, AND inside of a Frame, one of the buttons will ALWAYS be selected by default, when the form is initially displayed.
HOWEVER, if I place two option buttons in a frame, WITHOUT the control array, BOTH buttons are INITIALLY displayed UN-SELECTED.
See the attached screenshot for proof.
So what does my code look like you say ?
Well, I didn't type any. I just dragged the frames and buttons onto the form, and created the control array.
Would anyone care to explain why this happens, or better yet, is there a way to make the control array Radio Buttons appear UN-SELECTED when the form is displayed initially ?
I want to move controls on form with API.
I get the position on the control with GetWindowRect hwnd, cRect. (it received the control position related to the screen).
I add to the Top/Left some pixels, And then I set the new position with SetWindowPos.
This is my code:
public Function ChangeControlsTop(byval cHwnd as Long, byval TopStep as Long) as Long
Dim ControlRect as RECT
GetWindowRect cHwnd, ControlRect
ControlRect.Top = ControlRect.Top + TopStep
SetWindowPos cHwnd, 0, ControlRect.Left, ControlRect.Top, 100, 100, SWP_NOSIZE
The problem is that the SetWindowPos change the control position related to his parent, and it possible that this control is in other control(like picturebox) etc.
Is any body know how can I fit between the two position ???
Thanks for help
Paste With Position Control
Ok, this is likely stupid but I can't find an answer and I figured a guru here would know if from the top of his or her head
I am pasting text to a dropdown box as the user types characters into it, updating the dropdown as he goes along (that is the easy part)
To do this, I .clear the list with every character change, which means I have to clear the text, which means I have to replace it.
The pointer, then, is as the front of the text string instead of the end. What I need to do is to paste with the pointer at the end of the text string, so that the user can just keep typing
Anyone know how?
SelText Position In A Web Control
how i can find the SelText Start Postion and End Position in a Microsoft Web Control.i.e when i am in desgin mode whatever text i selected i want to display its Start x,y position and End x.y position in a contol.
Absolute Control Position
ok i want a function 2 find the absolute position of a control on the form.... for example if the control passed in is in 2 pic boxes it will return the twirps to the top left of the form
- i will be doing this kinda thing abit so i need a generic function -
Control Position On Screen
Any fast way to find a controls screen position other then getting the Left value of each parent all the way down to the form?
I want to replace the pixels in my picture box with the pixels of the DesktopDC but i gotta figure out the pixel position.
Absolute Control Position?
How can I know the absolute position of a control on a
form, using the upper left corner of the form as 1,1
These controls may be put inside other controls (nested)!
Would anybody help?
Control Startup Position
Hello all. I was wondering if anyone could tell me if it is possible to control the startup position of a seperate app? I am using VLC's media player to stream a terrestrial digital TV signal. The preferences with that app allow me to set the size etc but not the startup position. The code i use to launch the app from within my VB6 app is:
Code: Shell Chr(34) & "C:Program FilesVideoLANVLCvlc.exe" & Chr(34) & " -vvv udp://@188.8.131.52:5000 -- width 776 -- height -100", vbNormalNoFocus
If it is not posssible to directly control the startup position can anyone suggest some sort of work around. Thanks people
Shrek and Donkey and on another whirlwind adventure!
Force A Control To Take Top Most Position On A Form.
I'm using a 3rd party control to view documents( VSPrinter).
I want to draw a line and have it sit on top of the VSPrinter control but the VSPrinter control always puts the line underneath it.
Any solutions to this problem?
Cursor Position In A TextBox Control
I was wondering if anyone knows how to determine the cursor position within a textbox control, or if not,suggest a work around for the following scenario:
I have an MSFlexGrid that I want to allow users to edit. Obviously, a bit of programming allows one to place a text box over the active cell in the grid. This is easy, and works without incident, but I want to add a bit more functionality by allowing the user to use the up/down left/right keys from within the textbox control to move around the grid. THe catch is that I only want the left/right keys to change the grid cell if the cursor is in the first column of the text, or the last column of the text respectively. Since there is no guarantee that any text will be HighLighted, I cannot use .SelStart.
Any thoughts would be helpful,
Move Control To Mouse Position
Can anyone show me how to move a control to the exact mouse position. I've been using the pointapi when I click on my form but the mouse won't move to the loaction of the cursor,
How To Set The Position Of DataPointLabel In MSChart Control
I have a problem try to move the position of DataPointLabel in Pie chart.
I am not sure but I try to use offset property to change its position, but it doesn't work. The label still the same position.
.LocationType = VtChLabelLocationTypeOutside
.LineStyle = VtChLabelLineStyleStraight
.Component = VtChLabelComponentPercent
.VtFont.Size = 10
.Offset.Set 10, 2
.PercentFormat = "0.00%"
The offset.set is not work because when I debug I check (X,Y) value it still (0,0) rather than (10,2)
How To Control Line Position In A TextBox
I am using a textbox with MultiLine set to true. When the number of lines exceeds the height of the textbox the vertical scrollbar becomes active. How can I tell the topindex or the line position of a textbox?
btw: I havent been using this forum for very long and was wondering how to mark a thread as resolved.
Position Form Based On Another Control
Hello, I am working on this game and need help with some form positioning. Since I have used the game so far on a Windows 2000 and XP I am seeing an issue. I have the main form and then another form opening up ontop of this form. The form that opens is positioned to cover a specific part of the main form. If I do the math on one computer, it looks different on the other because of the change of the borders and everything, the top/left get messed up.
I thought I would use a control on the form. Like setting a border around the area and then usign its top/left position but I can get that to work correctly. Can someone help me position 1 form based on a location of a control on another, so on any Operating System, they will line up correctly.
Window Size/position Control
i have shelled explorer like this
One = Shell("explorer.exe a:", vbNormalFocus)
Now i want to control its size and position, I will alse be shelling another window,
Two = Shell("explorer.exe C:Documents and SettingsJonMy DocumentsJon", vbNormalFocus)
and i want One to be on the left half of the screen and Two to be on the right half of the screen.
Position A Textbox On A Richtextbox Control
I have to design an interactive form where there are lots of explanatory texts and then some textbox controls that should naturally merge into the flow of text. For example a form would have the following:
Your name is <textbox> and address <textbox>.
I have tried using a RichTextbox control where the text contains a specific tag where I expect the textbox to be. I then get the character position of the tag using Find method. Once I get the position I use getLineFromChar to determine the line on which the tag appears. I then use the average height of a character to determine the pixel position of the tag and add this to the top property of the richtextbox. However, I can't find a way to determine the positon of the tag from the left of the richtextbox. This would enable me position my textbox at a particular position within the RTB during runtime.
Does anybody have any idea on how I can achieve this ? Or else, is there an altenative to using RTB ?
I cannot replace the textbox controls since the user should be able to edit the name and address.
Capturing Mouse X Position In A Control
I need a way to capture the X position of the mouse in a control.
I tried using the MouseMove Event but it doesn't seem to get the info i need.
I need to find out the X position as the user moves the mouse within the control.
Position Of Nodes In A Treeview Control
Is there any way to determine the position of a node in a group of child
nodes in a Treeview control? For example:
Days of Week
I would like to be able to programmatically determine that Monday is the
first child node, Tuesday the second and so on. Also, if I drag and drop
the child nodes, I need to be able to determine the node's new position.
For example (as the result of a drag and drop):
Days of Week
I now need to know that Wednesday is the first node, and so on.
Thanks for your help
Text Position In Richtextbox Control
Hi Guys. I have spent the last few hours searching the internet trying to find out how to enter a string into the richtextbox control and have it display the string in the bottom left corner and stay in that position even if the form is maximised. Any subsiquent strings will scroll the control up.
Any ideas how to do this would be much appreciated.
Edited by - Gomjibar on 8/21/2004 7:05:43 AM
How To Get The Position Of Cursor In A Codemax Control
How to you get the cursor pos of the cursor in a codemax control.
I need it so I can use the command CodeMax.InsertText "Text", Pos as RECT
I know the position is a RECT, but Codemax does not have a command to retreave the curdor position, or I can't seem to finf it.
Any help would be great.
Window Position To Bottom Of Control
hi, i posted this question earlier, but maybe i didnt provide enough information. i have a window with a button on it. when the button in pressed another window opens up. how can i set the position of the new window to the bottom of the button control? any help would be appreciated. thanks!
Determinig The Position Of A Control On Its Parent Form...
Im making a graphical button control and I quite like the idea of a floating image when the mouse is over the control, but I cant quite seem to locate the control on the parent, I'm using the GetCursorPos API function to locate the mouse position wherever it is, but I need to compare that to the controls x,y co-ords in its parent... I tried this:
ObjectXCoOrd = UserControl.CurrentX
ObjectYCoOrd = UserControl.CurrentY
But it returns a 0 value all the time... Any help please? Just a pointer in the right direction would be great.
Access: Fixed Position Under Can Grow Control?
On my Access Report, I have two columns of data (to make it fit on one page). on the right side at the top is a Can Grow text box. It works well and pushes the information on the right side down properly, but it ALSO pushes the information down on the left side, even though no part of it extends over these controls. Is there a way to fix a position of a control so that the Can Grow textbox does not change its position?
This question has been asked before with no answer, but hopefully I can get one this time:
Calender View Control Position On Screen
I click a number of buttons to open a calender view
Can anyone tell me how to get my calender view to always open next to the button i pressed to open it
Screen Position To Form Control Math.... HELP!
I am using the
Private Declare Function GetCursorPos Lib "user32" (lpPoint As _
POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
Dim a As POINTAPI
Dim b As Long
Dim c As Long
API to read the position of the mouse.
Now I need my form to use twips since I dynamically am adjusting position of all form controls on form resize and I tried pixels and it was a mess.
Now I use the mouse position in conjunction with Microsoft HTML Object library pointing to the currently loaded page in the webbrowser control.
Say a link is on the page. I use the mouse X,Y to check if it is over a link.
The API returns positions that to not work with the browser.
I will be like 30 pixels above a link and it thinks I am on it.
I tried adjusting it and it still didn't work.
Is there some math solution to get the returned X and Y to be X and Y for the browser control? Wouldn't it have to account for different screen resolutions and form sizes?
The code attached is in VB 5.
Thank you for any help
Control Text Position In Print Document
I want to print some text from a string. But the text printed at the left edge of the paper... how can i control the text position so that the text can be print to other area of the paper??
How To Position Selected Item To Top Of Listview Control
The codes below allows me to search for a particular item in the listview control by typing a search text. How can I position the selected item to the top of the listview control ?
Thanks in advance.
Private Sub txtSearch_Change()
Dim itmX As ListItem
Dim sSearch As String
Dim iTest As Integer
sSearch = txtSearch.Text
Set itmX = lstvFields.FindItem(sSearch, , , lvwPartial)
Set lstvFields.SelectedItem = itmX
If itmX Is Nothing Then
itmX.EnsureVisible ' Scroll ListView to show found ListItem.
itmX.Selected = True ' Select the ListItem.
lstvFields.SetFocus ' Return focus to the control to see