Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




User Controls Coordinates On A Form


If I place a user control on the form, how can I get it's x and y?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
User Form With RefEdit Controls
New poster referred here through an Excel site...

First, let me state that I have very little experience with VBA for Excel. However, that doesn't mean i'm not willing to put in the time and effort to learn. I've searched google, Walkenbach books, and other forums, but I still don't know exactly how to approach the issue below.

I would like to create a user form that will permit the user to declare up to ten unique ranges within one Excel sheet by using RefEdit controls. With the results of the user input I would like to do one of two things: use each range address to build a named range within Excel; or simply put the range address inside a specific cell(s). Normally, I would use a dynamic range for this, but each of the ranges (potentially upto 10) will very in height. If it helps, the data comprising these ranges comes out of a web-based order-entry tool.

So, I've built the form, figured out how to launch it, but I have no idea as to what the code should look like. Through some research, it looks like part of it will look like the info below.

Private Sub OKButton_Click()
Dim Addr as String
Addr = RefEdit1.Value
ActiveSheet.Range("F1").Value = Addr


Unload Me
End Sub

Of course, this doesn't work. Furthermore, I need to account for the possibility of the user defining up to 10 ranges.

Hopefully i'm not asking for too much. Any help would be greatly appreciated. If I get this to work, it sill shave a significant amount of time of some individual's daily routine.

Zooming A Form Containing Various User Controls...
I need to be able to Zoom my form like Word can do with documents (i.e. 25%, 50%, 75%, etc).

I have a form with 3 usercontrols added to it dynamically. The form has scrollbars and such so that the user can scroll to see the controls. However, I want to be able to zoom out so that all 3 user-controls can be seen without the use of scrollbars. Is this possible to do with user-controls on a form?

Other info: The form is a GUI display of some Gov't standard insurance forms. The insurance forms are so large that separate user-controls needed to be created to add them all to the same form (resulting in the need for scrollbars.) The same form is used to display other insurance forms that use different user-controls.

Form Key Preview W/User Controls
I have a MDI app that uses the KeyPreview of child forms for some simple shortcuts. This allows my form to preview keyboard events before they get passed to the active control. However, on child forms that use user controls, the keyboard events don't seem to ever make it to the form (i.e. only the user controls see the keyboard events). Is there a way to automatically "bubble up" keyboard through from user controls to the form, or do I have to write an event handler for each instance of a user control? Thanks

User Controls And Form Declaring
Hey guys, i'm stuck trying to get my code that's inside my user control to call other objects that are on lets say, frmmain.

I was able to call objects that are on the control from forms by adding:

Code:
Public ctrlDL As ctrlDownload

to a module.

Is there a way i could do the samething for frmmain that will allow me to be able to call a listbox from my user control?

Thanks!

User Interface Question (VB Form With Many Controls)
I'm just curious how other Programmers deal with designing forms with a large number of controls or large amount of information. My programs requirements are that everything I'm displaying is shown to the user at once (no tabpages etc). I'm using Frames and trying to organize my form nicely, but with 60+ textboxes, many labels a flexgrid and a toolbar the form doesn't look great. How do you guys deal with forms like this. Are there other good methods for grouping/seperating pieces of information (labels/textboxes) other than frames? With a web page there seem to be many more display options, but this program requires a "rich" client interface.

User Controls Added To Form At Runtime
After Googling myself to death, I have turned to the one place that can usually provide an answer.  Why I did not start here I don't know.

Requirements / Desires

VB6

I have a project with
1 picture box      named picture1
1 File list box    named fileObjects
1 command button
1 usercontrol defined in the project.  This control has a pitcture box in it at the moment.  I was trying not to use a picture box but to set the picture of the control and thought this might help with the visibility problem after the control is inserted.

Here is what I am trying to accomplish
After choosing a file (File list is a list of gifs in a directory).  I want to click the button and have an instance of the user control placed in the forms picture box and assign the user controls picture to be the picture from the list box.

Currently I have tried the controls.add method and the code runs fine but the control is not visible or actually on the form.

I can place the control on the form at design and changes its picture at run time no problem.   Getting the control to be visible and moveable after on the form.

Eventually I will be adding an unknown number of these user controls to the form to display what is effectively a layout of objects in a field or in a room.   The gifs are pictures of the actuall items.  

I need the following example code or help
1.  Actually adding the controls to the form at runtime and having them have the ability to get control simply for the purpose of moving them around.

2.  I may need some help with the coding of the user control to allow for its ability to be dragged after on the form.

This is my first jump into user controls of this nature.  Spent all my programming time in the DB world and business logic/problems solving coding.

So far my coding on my button is this

Dim myControl As VehItem
    Set myControl = Controls.Add("project1.VehItem", "VehItem1", Me)     'This will be changed in the future to name it incrementally after I get the first one to work right
    
    Picture1.Picture = LoadPicture(App.Path & "imagesObjects" & fileObjects.FileName)
    Set myControl.Picture = Picture1.Picture



So far my coding in my first user contorl is
Option Explicit


Public Property Set Picture(ByRef newpic As IPictureDisp)
    Picture1.Picture = Form1.Picture1.Picture
End Property

Private Sub UserControl_Initialize()
    Picture1.Picture = LoadPicture(App.Path & "imagesVehiclesTruck.gif")

End Sub
 

Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Get Coordinates Of All Controls...
I got alot of items on my form. I need a way to get the coordinates of every item on the form. I need to get the Height, Width, Left and Top coordinates.

Right now, I use this:

Code:
WriteINI object, "MainWindowTop", Form1.Top, coordinate
WriteINI object, "MainWindowLeft", Form1.Left, coordinate
WriteINI object, "MainWindowHeight", Form1.Height, coordinate
WriteINI object, "MainWindowWidth", Form1.Width, coordinate

WriteINI object, "RTBTop", Form1.rtb.Top, coordinate
WriteINI object, "RTBLeft", Form1.rtb.Left, coordinate
WriteINI object, "RTBHeight", Form1.rtb.Height, coordinate
WriteINI object, "RTBWidth", Form1.rtb.Width, coordinate
I need a easier way to save coordinates.

Is there a way to do this?

User Controls Dont Copy, When Form Copied Into Another Project
I have a Form with some user controls on it.
When the form is copied into another project, the user controls don't come with it.
I get picture boxes instead.

My current form has a user control frame, and it contains some user control buttons.
None of them copy across properly.

But even on my simpler Forms, with no frame, just user control buttons, I get the same problem.

(I have previously included the user controls into the target project)

If there is trick to it, I would appreciate hearing about it.

Thanks,

Controls Coordinates After SetWindowPos ?
Dear All,

I am using API to change the appearance of certain controls (List boxes in this case) as follows


Code:
Public Sub ControlCaption(Controlname As Control, SetTrue As Boolean)

Dim dwStyle As Long
dwStyle = GetWindowLong(Controlname.hwnd, GWL_STYLE)
If SetTrue Then
dwStyle = dwStyle Or WS_CAPTION
Else
dwStyle = dwStyle - WS_CAPTION
End If
dwStyle = SetWindowLong(Controlname.hwnd, GWL_STYLE, dwStyle)
SetWindowPos Controlname.hwnd, Controlname.Parent.hwnd, 0, 0, 0, 0, _
SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME _
Or SWP_FRAMECHANGED Or SWP_SHOWWINDOW

End Sub


This gives the Control a TitleBar.
I can now click on the titlebar and move the control around the form.

However the controls .Left and .Top properties are not updated.
They remain at the value they were when the controls parent form was loaded.

Can anyone tell me how to get the control to update these properties.

Many thanks

GT

Need Help To Find The Coordinates Of Controls From Usercontrol
Hey All,

I want to create a (.ocx) control which acts as a container for other controls. but during the run time the activeX (.ocx) must be transparent and only the controls which are placed during the design time must be visible.
For this i create a ocx setting the contained control property =True.
Here i used the CreatePolyPolygon (WINAPI) and SetWindowRgn Api's.
But from within the usercontrol i am not able to exactly get the coordinates of the other control which are placed on my usercontrol.


i used
X = usercontrol.ScaleX(ocontrol.Left,usercontrol.scalem ode,vbpoints)
Y= usercontrol.ScaleY(ocontrol.Top,usercontrol.scalemo de,vbpoints)

the above code returns a point, but is not exact.
Please let me know how could i exactly retrieve the coordinates of the controls which are placed on my usercontrol from within my usercontrol.

Please help me

Prior Thanks for all.
with regards,
K.Senthil babu

Dynamically Adding User-created Controls To User-created Controls -- For Gurus
dear all,

i have created two UserControls, control1 and control2.

i need to have multiple instances of control2 running into control1, and i need to catch the events of these instances.

i would have, in control1, declared this:

VB Code:
Private WithEvents ctl2() As control2

unfortunately you can't declare an array with WithEvents.

I've seen a method that works by encapsulating control2 into a class, and then adding this class to a collection.

my questions are:

1. is there another / easier way to do this?...

2. how do i dynamically add control2 to control1?

VB Code:
Dim mCtl2 As control2Set mCtl2 = New control2Set mCtl2 = control1.Controls.Add("Project1.control2", "CTL_" & index)

doesn't work since .Controls is not a method of the object...

any suggestions?...

Form Taking Size && Coordinates Of Previously Displayed Form
hi

i have an application in VB5 running fine on NT and 98. when i loaded same on XP PC, it installed properly.

the application shows screen1, accepts data then shows screen2. but on one XP machine , i get only top left side part of screen2.

i observed (may be wrong ) that size of screen 2 is same as screen 1.

is there anypossibility that it is taking those coordinates and sizes of previous screen ?

this did not happen on other XP pc.

harshad

User Controls And Windows Installer --controls Aren't Getting Registered
Hi,

Can anybody give me the rundown on what I need to do toget my user control to install with my application. I have a moving graphic control that uses a slider [MS windows Common Conrols 2(6.0)].It runs just fine when I test-install on my development drive--Win2K Pro on my secondasry IDE..

Well, that's no big trick since VS 6 Enterprise is already installed, and my control was registered locally when I built it. The problem is that when I reboot to my testing drive--NTS4 on my primary IDE-- it finds a data type mismatch. At first, I was getting a message saying that MSCOMCT2.OCX was not properly registered, or that a component was missing. After I included the control in the components for my main project [where it is not used directly, only through my user control], I no longer got the error for that component. It still doesn't start up properly though. I'm wondering what I'm missing in my installer.

Another thing I'm wndering about--and I don't know if this is related--is the ADODC controls. I have had problems with the events for these controls. A week ago, when I tried switching from ADO 2.0 to ADO 2.5, the compiler didn't recognize the signatures for these events, and I had to switch back to get them to work. Now the situation is reversed. The compiler started objecting to ADODC events again, and I had to switch the reference to ADO 2.5 to get the program to compile. Could this be the source of the data type mismatch that NT4 sees?

Any suggestions for how I can get the installer to install dependably would help.

Thanks,

Joseph

Joseph

Referring Controls Of User Controls In Class Module
Hi,
I'm developing an ActiveX control for Web application. ActiveX control has User Control form and Class Module. I want to refer the image control placed in user control in Class Module. Can u please send me a sample coding.

thanks in advance,

About The Coordinates On The Form
hello everyone!

Here's my idea: The user can draw rectanculars on the form anywhere they want by enter 3 kinds of datas on a table: the x,y coordinates, the width and the height.

Could anyone give me some hints that how can I realize this idea?

Here's my question:
1, If the top-left point of the form's coordinate is (0,0), how can I define the bottom-right point of the form's coordinate? say, like(-200, -200) is what I want for the bottom-right point. Because it's no use for the user to have ability to draw rectangular on every pixel or every twip on the form.

2, By which way can I connect the table to the drawing? So every time I run this program the form will immediately show the rectangulars which the user wants on the table.

I'm new in VB and your help will be very appriciated. Thanks guys!

Form's X, Y Coordinates
Hi there everyone, I hope someone can help on this, mostly because I haven't found a good answer anywhere on this forum, but I might be looking for the wrong thing.

I have a form that is ACTING like an MDI form, using the setparent API. Call this form, frmMain.

The subforms are being loaded on a textbox on frmMain. Now, I'm having a problem where when frmMain is made smaller than the size of the subforms, then I would like to show scrollbars either vertically or horizontally. My problem comes in when multiple forms start showing up in frmMain. For some reason I can't get an accurate x,y coordinate of where the subforms are. Is there any way to fix/do this? If anyone has an idea or something, I'm very open to suggestions! Thank you.

Passing User Defined Types To User Controls
I think I have bitten off more than I can chew here.

I have a user control with text boxes, amoung other objects, on it.

I want to pass a User Defined Type, containing the values of the text boxes to and from the control.

If i declare my UDT in a .bas module, i get error that I cant pass private UDT to this control. On further reading I then put the declaration in a seperate active X project (early binding so Im told) this doesnt appear to work either saying type mis match between calling code and UserConmtrl declaration.

Does anyone PLEASE know an easy way to pass a UDT to User Contols, this is driving me nuts - there must be a simple way.

Thanks in advance to anyone that can shed light.

Skiier

Using GetCursorPos For Form-Coordinates
The x and y coordinates returned by GetCursorPos are by default screen coordinates. Any way to adjust them to coordinates to show the position within a form? Tihs needs to be independant of screen resolution... How would you do that????

Finding The Coordinates Of A Form..
I have a form that opens at "Center Screen." I'd like to find out what the coordinates of the top and left corners are so that I can place a form on top of that form at a "relative" location.

If I look at "form.left" it contains a value of -15 ... This doesn't seem reasonable to me. The CurrentLeft doesn't seem to do too much for me, either.

Anyone have any ideas?

Thanks..

Finding The Coordinates Of A Form..
I have a form that opens at "Center Screen." I'd like to find out what the coordinates of the top and left corners are so that I can place a form on top of that form at a "relative" location.

If I look at "form.left" it contains a value of -15 ... This doesn't seem reasonable to me. The CurrentLeft doesn't seem to do too much for me, either.

Anyone have any ideas?

Thanks..

Coordinates Of Mouse Over Form
I am trying to set a forms position by where the mouse is.

I want to click on a TreeView node and have a small form popup under the
node.

Help
Bruce

Bruce Thew
Real programmers don't comment!
It was hard to write it should be hard to Read!

Maximizing A Form In Our Coordinates
I want to use two forms on the screen area in an MDI application. when i maximize one form it come over the whole window, while i need that it should not go over the other form. so that both forms should be visible.

ok

Exposure Of Controls Within User-created Controls
I'm playing the lottery here because I'm sure my question is so specific that only a few may know the answer, but what's life if you take no chances? Sorry for the epic nature of the post, but to boil it down - I need to know how to make a user control with standard VB controls on it exposed to the outside world.

I am using Borland's Silktest to test a complex application written in VB6.0 and C++ (COM). Silktest is pretty clever - it somehow automatically grabs out the bits of the interface so that you can write automated testing applications that interact with the application rather than recording keystrokes and mouse clicks.

What happens is you run your application with Silktest pointing at it. Silktest will recognize ActiveX controls and allow you to interact with those controls in your script, so I may see a text field and be able to read what's there, or even insert data into the field.

However, we've noticed a really odd thing - on a panel that my company wrote, if that panel contains user-built controls, those controls are fully exposed to Silktest. However, if that same form has something simple on it, like a VBLabel (which Silktest has built in support for!) it won't show up at all. As I mouse over our home-grown controls I see them show up with a unique identifier in Silktest. As I mouse over a vanilla VB label, I see it represented as an image, along with the entire rest of the control.

I think the problem has to be that the simple controls are not exposed to the outside world in the same way as our user built controls. My question for the VB gurus of the world - is there something I can do to expose these controls? If so, where do I get at it?

My developers are swamped, and they didn't know the answer off-hand. I will try to get VB loaded on my system and start experimenting, but I thought that just maybe someone knew the answer offhand.

I have to throw myself on the mercy of the boards - I am 5 years from any kind of real programming. I'm now out of retirement to write some automated testing scripts for an application I worked on an eternity ago. If it sounds like I don't know what I'm talking about, I'm sure you're right!

And thanks for reading if you made it through!

User Form Oddity - How Do I Make A User Form Inactive But Visible
Hello,

This is my first thread on this forum and (guess what?) I have a question: I have one spreadsheet (Excel 2002, XP Office Pro) and I use one modeless User form with one command button on it. When clicked, the button is coded so that cell "C4" is selected.

When the button is clicked for the first time after the form is loaded/shown for the first time, cell "C4" is selected and the user form become inactive (blue bar on top of the form becomes grey). GOOD

Here comes my problem: if I click again (that's the second time now) on the button, Cell "C4" is selected again but the form remains active (blue bar on top of the form remains blue). BAD!

I need the form to inactivate again so that the user can edit the content of the selected cell without having to use their mouse and manually select it!

Does anyone know what I could do to ensure the form become inactive each time after I click on the button?

Best regards
Francois

MouseMove, Getting Coordinates When Mouse Is Not On Form.
Howdy,

How can I get the coordinates of the mouse in the Form_MouseMove event when the mouse is not on the form?

Thanks.

-compuXP

Position Form Using Mouse Coordinates
hi guyz,
when the user clicks a label on a form, i wish to load a new form and position the new form such that the new form's top-left hand corner is at the mouse's coordinates.

i know how to use GetCursorPos to get the mouse coordinates but after that i'm lost.

thanks for your help guyz...

Can We Determine Image Coordinates In Form?
I have an image and it has three parts divide like contact,help and Phone.

if it is in Html we can determine where user clicks accorging to its Coordinates.

Can we do it in VB form?Like if I load same image in form How to recognize coordinates?

Thanks.

Convert Regular Coordinates To 'system' Coordinates
I'm attempting to make a checkers program. A regular checkers board is the same as the chess board (64 squares) where the normal board coordinates are as follows...

** 01 ** 02 ** 03 ** 04
05 ** 06 ** 07 ** 08 **
** 09 ** 10 ** 11 ** 12
13 ** 14 ** 15 ** 16 **
** 17 ** 18 ** 19 ** 20
21 ** 22 ** 23 ** 24 **
** 25 ** 26 ** 27 ** 28
29 ** 30 ** 31 ** 32 **

Now, for programming purposes it's better to set up the coordinates as follows...

** 05 ** 06 ** 07 ** 08
10 ** 11 ** 12 ** 13 **
** 16 ** 17 ** 18 ** 19
21 ** 22 ** 23 ** 24 **
** 27 ** 28 ** 29 ** 30
32 ** 33 ** 34 ** 35 **
** 38 ** 39 ** 40 ** 41
43 ** 44 ** 45 ** 46 **

The reason for using different coordinates programmatically is simple. This way, all pieces can move to a number that is 5 or 6 higher than it's coordinate if it's a red piece, and 5 or 6 lower than it's coordinate if it's a white piece.

Anyways, I need to be able to conver coordinates from the regular coordinates to the 'programmable' coordinates and back.

I know how to convert from regular coordinates to 'programmable' coordinates like this

VB Code:
Public Function getInterCoord(boardCoord As Integer) As Integer    getInterCoord = 3 + boardCoord + (boardCoord + 3) 4 + Fix((boardCoord - 1) / 8)End Function


This part works, however I've tried everything and I can't make a function like this that will take the 'programmable' coordinates and return the regular board coordinates.

Can anyone help me out?

By the way, I know you could simply have a bunch of if statements in there , but this routine has to be as efficient as possible because it will be used thousands of times within another routine in my program.

Window Corner And Form Mouse Coordinates
They say a picture is worth a thousand words and this would take forever to describe so here is is
http://students.db.erau.edu/~hammj/vbdiagram.GIF

ok the problem is i cant get the mouse coordinates so they will work with the program. i have the api stuff that gets the window pixels and another that gets the mouse coordinates but i have trouble when it comes to getting it to be calculated properly. i think it should be something like:

pseudo code:
formX = mouseX - formWindowX
formY = mouseY - formWindowY

the purpose is to get the coordinates and draw a circle around the dot.

thanks for the help,
BillW42

Position Second Form At Mouse Cursor Coordinates
I have a label on my first form.

When I right click on this label, i want a second form to open at the mouse coordinates of where I just right-clicked. So the left/top properties of the second form are right at the mouse cursor.

how can i do this ?

Retrieving Mouse Coordinates In Form? *Resolved*
Hi,
I want to set the caption of two labels to the X and Y mouse coordinates when the user presses a command button.
How do I retrieve them in an expression? I have tested Xmouse and Ymouse but that didn't work.
Any help will be appreciated



Man, being a newbie sucks ^_^. But I'll not give up until I'm a pro in VB

Reading Cartesian Coordinates In Exponential Form....
Hallo all!

Here i am again, with a different problem this time. Any input would be highly appreciated... Please bear with me, first time with visual basic...

Ok my problem is thus, I have to read a STEP file (which is a data exchange format in CAD) and make sense of it all.

The problem I am facing is like thus... the file has the following format
#3=CARTESIAN_POINT('',(0.E0,0.E0,0.E0));
#4=LINE('',#3,#2);
#6=DIRECTION('',(0.E0,0.E0,-1.E0));

Now somehow I have to make the program understand that 0.E0 and etc stands for 0 x 10 power 0, or 0 or -1.E0 standing for
-1x10^0 or 1.E2 standing for 100 ie 1x10^2. Is there a way to do this? I am stymied again, my knowledge of VB is really nto that deep at all... I would appreciate any feedback on how it can be done...

Thanks all
Pete

Location (i.e., X,y Coordinates - Height And Width) For A Control On A Form
There has to be an answer to this question...

I have built an interactive form in Access which deals with an engineering drawing. I have placed transparent labels to grid the drawing into 45 seperate units. When the user clicks on a grid, they can see items which are currently placed there. The question is...

How can I return the location of the label relative to the form so that I can fade the main form out, fade the pop-up form in (accomplished), and transfer the form image of the SELECTED GRID ONLY to the pop-up form?

I have set up the code for capturing the active form image to a picture box on the pop-up form. In this case, I cannot retrieve the handle for the label due to the fact that I cannot set focus to the label...

Aside from setting the coordinates manually for each label, can this be achieved?

I have attached a small image of part of the form for visualization purposes. Thanks in advance for any feedback!

User Controls Being Painted Over By Other Controls , Please Help !!!
the problem i am facing is this control is being painted over by any other controls on the form.

can u please help me in this.

thanks

bye

pratik

User Controls And User OCX Problem
Excuse me if this is a stupid question but I am fairly new to VB...

I have a user control (myOcxControl.ctl) and a form (myOcxForm.frm)
that are part of an ocx (myOCX.ocx). I have another form
(myForm.frm) which is part of a vb project which uses myOCX.ocx

The user control has a private sub myOcxControl.command1_Click()

Which calls public sub myOcxForm.getData()

In getData() it calls...

Me.Show vbModal

I want it to change this line to

Me.Show vbModal, myForm

How do I get myForm visible to the modules in myOCX.ocx??????

Thank you

Andy

Make A Listbox (or Whatever User Control) Automatically Resize When User Resizes Form
Is there any option, event, or whatever I can trigger to make a listbox (or whatever other user control) automatically enlarge when a user enlarges the form?

eg. the listbox is almost as big a the form (with small margins) and the form is of a specified size. Whe the user maximizes the form, the dimensions of that listbox don't change. How can I make them change automatically?


thx

Compare Main Form Controls To Subform Controls
Hello,

I have a form frmMissyFact and within this form I have a subform frmMissyFactbackup. the sub form is an exact copy of the mainform. The data source is different. What I am trying to do is compare the controls value on the mainform to the controls value on the sub form and if they don't match set the back color to Yellow. Basically the user want to know what has changed from the week before. I am trying to use a for loop. this is the code I have.

Private Sub Form_Current2()

Dim ctl As Control
Dim frmMain As Form
Dim frmSub As Form

Set frmMain = Me
Set frmSub = Me.frmMissyFactbackup.Form

For Each ctl In frmMain.Controls
If ctl.Value = frmSub.ctl(ctl.Name).Value Then
'set to normal color
Else
ctl.BackColor = vbYellow
End If
Next ctl

I keep getting a runtime error. Application defined or object defined error.

Does anybody have any Ideas on how i can make this work. I know I can write an if statement for each control but if theres a loop I can use it would be better.
Thanks,

User Controls VB6 > VB5
Hi people,

Been using VB for a while now, but have only ever written programs for the computer i was working on...

I've written a nice control to handle multiple winsock clients on my home computer VB6, and i need to move it to a college computer (to write a simple net-game).

Heres the problem:
They use VB5 Learning Edition, which doesnt allow user controls to be written, so i'm gonna have to compile it at home but i know for a fact that they also dont have the MSWINSCK (winsock) control....

I've used Packagement + Deployment wizard and i believe it included all needed files for my user-control to work, however will i be able to use my user control in design-time (VB) or not?

so,
Will ALL needed files be included and registered? and...
Will I be able to use my control at design-time?

thanks in advance!

XP User Controls
Where can i download the XP user controls for vb6? i really need the xpcmdbutton..... where can i get it?

User Controls
I'm using VB6 and have written a user control for a multi column combo.

I've done this is the normal way, by adding a user control to a project and I have included the control in one of my forms.

So far so good!

Now the form that uses the user control is also included in another project. It failed to work, so I added the user control into that project as well, re-loaded the control onto the form and it worked. Only problem is that it doesn't work in the original project!

Investigating the frm file is contains an entry:

Begin ProjectA3845.MCombo cmbCombo
Height = 315
Index = 0
Left = 1680
TabIndex = 10
Top = 2160
Visible = 0 'False
Width = 3855
_ExtentX = 6800
_ExtentY = 556
Object.Tag = ""
ForeColor = 0
FontBold = 0 'False
FontItalic = 0 'False
FontName = "Arial"
FontSize = 8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Columns = 1
End

My problem is with the first line of this code extract. The control is directly related to the project (ProjectA3845 in my case).

I do not really want to compile the control into an ocx as I would like to be able to modify the user control in either project and I still want to use the form in both projects so I don;t have to maintain 2 identical sets of code.

Any ideas?

User Controls Again!
Two Quick Questions:

1. When a user picks a backcolor to my custom button what is the best way to get a shade of this color lighter and darker to draw the borders with?

2. In examples I've seen of User Controls in the "Public Let PropertyName ..." sub people put "PropertyChanged 'PropertyName'". What does this do? Does it make an event for this, if so what is it called because it would be useful to redraw whenever the property changes.

Thanks everybody.

User Controls...
I have a question: How do i make properties to an usercontrol (for example how to change a picture's .picture property?

User Controls
I created a user control and placed it on a form. The control has several functions but I cannot figure out how to invoke them. I thought it would be as simple as writing...

ControlName.FunctionName

but this doesn't seem to work. Can anyone help?

User Controls
When I have a user control on one of my forms, after running the program there are diagonal lines going through the controls and they don't look as they should. Also, not all of the properties are displayed. Any idea what causes this or how to fix it? It happens on both my comps so a reinstall isn't the answer. It happens with every single user control I've used, which admitedly, isn't many. (I'm using VB 6.0 Prof, btw)

User Controls
I have a user control with 6 combo boxes each with a corresponding text box i.e. cbotype1 txttype1, cbotype2 txt type2 etc.
All the combo's are populated with the same data e.g customer type(owner,dealer etc).
When I select a user type from a combo I want to search the DB for data relating to this customer and populate the corresponding text box with their firstname & surname.

I have the following code at present not much though....

PRIVATE SUB CBOTYPE1_CLICK()

IF CBOTYPE1="OWNER" THEN
GETOWNER
ELSEIF CBOTYPE1="DEALER THEN
GETDEALER
ELSEIF ETC ETC ETC
END IF
END SUB

PRIVATE SUB CBOTYPE2_CLICK()

IF CBOTYPE2="OWNER" THEN
GETOWNER
ELSEIF CBOTYPE2="DEALER THEN
GETDEALER
ELSEIF ETC ETC ETC
END IF
END SUB

ETC ETC

PRIVATE SUB GETOWNER()

DIM SSQL AS STRING

SSQL="SELECT ETC ETC ETC



END SUB

PRIVATE SUB GETDEALER()

DIM SSQL AS STRING

SSQL="SELECT ETC ETC ETC


END SUB



I DON'T KNOW HOW TO GET THE RESULT FROM HERE INTO THE TEXT BOX. CAN ANYONE HELP?

THANKS

User Controls
Hello,

I'm new to user controls. I've been just given one to impliment into my project and not sure how to go about implimenting it into my code to utilize it.

Is there a tutorial or something I can look at for User Controls? What is does in a nutshell is creates a string based on information that can be taken from a form, and then sent to a server (via winsock) and then the server replies with a string.

I'm stumped.

User Controls
I've never done anything with user controls(And I mean Nothing!), I found a cool button on one of the source code sites, and was wondering if anyone could tell me how to add a user control to your form, or if you could point me in the direction of a tutorial, that would be great as well. Thanks.

User Controls
I am thinking about building a user control for my project and I have a few questions reguarding the user control to see if it would be worth my time to learn to build one. First I should explain what I want to do. I would like to have a MSFlexgrid with 6 Columns and 13 rows with one fixed row. Row 1 To 3 would be vbblue, 4 To 6 would be vbyellow, 7 To 9 would be vbred and 10 To 12 would be vbgreen. Plus I need to format the size of the cells and a few other properties. The reason I am thinking of doing this is because I need to use the same flexgrid several times in my project. My first question is this possible to do. My next question is do I build this control in my project or do I start a new project and build it there. And my last question is, is a user control like any other control where you can use it as many times as you want in a project.

User Controls Vs Non-user Controls
Given a reference to a control, is there a way to determine whether or not it is a user control? The best I can come up with is to test for the control's Object property. If this causes an error then the control is not a user control. But is there a way to do this without generating any errors?

Copyright 2005-08 www.BigResource.com, All rights reserved