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




Move Form By Child Control Doesn't Work With 6.0


For some odd reason MSDN doesn't put any 6.0 based code on their site, and that means I usually have to translate to 6.0 code myself from .NET code.

How do I do this though:

This is the code they suggested for dragging a form using a child control:

Option Explicit
Private Declare Sub ReleaseCapture Lib "User" ()
Private Declare Function SendMessage Lib "User" (ByVal hWnd As _
Integer, ByVal wMsg As Integer, ByVal wParam As Integer, _
lParam As Any) As Long

Private Const WM_SYSCOMMAND = &H112
Private Const MOUSE_MOVE = &HF012

' Enter the line below as one line of code
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Dim lReturn As Long
Call ReleaseCapture
lReturn = SendMessage(Form1.hWnd, WM_SYSCOMMAND, MOUSE_MOVE, 0)
End Sub

But that doesn't work for 6.0. It says it can't find file User, which is the Lib MSDN told me to use

Do you guys have any suggestions?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Keydown Doesn't Work With WebBrowser Control On Form?
I am making a game where there is an animation, but now the hero won't walk! (the hero is not the animation) How can I make him move while having the webbrowser control on my form?(i'm using the webbrowser control to load an animated gif)

Thanks A Bunch!
Steve

Child Form Doesn't Respond On The First Click
I had to replace Sheridan ActiveListBar control with DBI-Tech ListBar on MDI form in my VB6 app. I spent a lot of time on that replacement without paying attention on Children forms behavior. After click on a new ListBar one Child is replaced with another one (for instance there was Customer form and after click it was unloaded and Supplier form was loaded). The first click on Supplier form doesn't do anything. Form behaves as disabled. The second click works as it should. It doesn't matter where the first click is done - any button, check box, combo. Just no any reaction.
Any idea why it's like that?
I tried to find some work around by setting focus on controls, by calling Click event procedures. Nothing helps. Only manual click makes the form responsible.

Thank you
Vlad

Making A Child Form Not Move Within A MDI Form
How can you make a form not move within another form. I have created an Outlook type toolbar and I wish for it not to move within my MDI form. How is this done?

Thanks in advance,
Jeff

Control+C To Copy From Textbox Doesn't Work As ActiveX Control In IE
Hello all,

I've got a wierd problem that I'm trying to figure out. I've created an activeX control using vb 6 sp5 for use in IE 5 and higher. The control contains a textbox and does some things that aren't important to this question like getting the linecount, etc...

When I run my control from vb, a control+C allows me to copy text, however, once I build the control into a cab and then view it on a web page, control+C won't copy text.

You can easily recreate this problem by simply creating an activeX control in VB with a multiline textbox with vertical scrollbars on it. Play it from vb and a control+C works fine, build a cab and look the web page the PDW creates and the control+C won't work.

Any ideas why this is happening and if there's anyway to make it work?

Thanks for the help!

SendInput... Doesn't Work? Keybd_event... Doesn't't Work In Win2K
I am trying to doo a shift-insert (paste) to a richtextbox.
My code for the keybd_event works fine in Win NT and Win 98 but doesn't work in Win2K even though it says it is supported. Here is my code for SendInput which looks good to me but doesn't work?!?

Dim inputevents(0 To 3) As INPUT_TYPE ' holds information about each event
Dim keyevent As KEYBDINPUT ' temporarily hold keyboard input info
Dim mouseevent As MOUSEINPUT ' temporarily hold mouse input info
Dim ret As Long

' Load the information needed to imitate pressing the shift key.
With keyevent
.wVk = VK_SHIFT ' the shift key
.wScan = 0 ' not needed
.dwFlags = 0 ' press the key down
.time = 0 ' use the default
.dwExtraInfo = 0 ' not needed
End With
' Copy the structure into the input array's buffer.
inputevents(0).dwType = INPUT_KEYBOARD
CopyMemory inputevents(0).xi(0), keyevent, Len(keyevent)



' Load the information needed to imitate pressing the insert key.
With keyevent
.wVk = VK_INSERT ' the insert key
.wScan = 0 ' not needed
.dwFlags = 0 ' press the key down
.time = 0 ' use the default
.dwExtraInfo = 0 ' not needed
End With
' Copy the structure into the input array's buffer.
inputevents(0).dwType = INPUT_KEYBOARD
CopyMemory inputevents(0).xi(0), keyevent, Len(keyevent)



' Do the same as above, but for releasing the insert key.
With keyevent
.wVk = VK_INSERT ' the insert key
.wScan = 0 ' not needed
.dwFlags = KEYEVENTF_KEYUP ' release the key
.time = 0 ' use the default
.dwExtraInfo = 0 ' not needed
End With
inputevents(1).dwType = INPUT_KEYBOARD
CopyMemory inputevents(1).xi(0), keyevent, Len(keyevent)


' Do the same as above, but for releasing the shift key.
With keyevent
.wVk = VK_SHIFT ' the shift key
.wScan = 0 ' not needed
.dwFlags = KEYEVENTF_KEYUP ' release the key
.time = 0 ' use the default
.dwExtraInfo = 0 ' not needed
End With
inputevents(1).dwType = INPUT_KEYBOARD
CopyMemory inputevents(1).xi(0), keyevent, Len(keyevent)

' Now that all the information for the four input events has been placed
' into the array, finally send it into the input stream.

ret = SendInput(4, inputevents(0), Len(inputevents(0)))

ShowInTaskbar Doesn't Work With MDI Form
I have a parent MDI form with a few children (what a nice family ).

Now I want the parent MDI form to be removed from the Taskbar (because it is minimized to the system tray). But MDI forms don't have the ShowInTaskbar property...

Maybe there is an API function to remove it from the Taskbar?

I've already searched this forum but dind't find anything...

Thanx a lot!

Voice Diction Control Doesn't Work In Vb6
i want to add speach recognition program to my application so i downloaded sdk5.1 from microsoft n also the sr and tts engine required for it. all the liberaries and the controls appear in toolbox and r working with the sample code and programs i downloaded from "codeguru.com" besides the "voice diction control " . as we place it on the form, it makes the system unstable and vb doesn't works any more while all the voice related liberaries like (microsoft direct speech recognition, microsoft voice dictation, microsoft voic commands and others related liberaries) are included in the program.
it don't work n sometimes hannged the vb. please help me to how to run the "voice diction control" properly. also tell me in detail about some of the common functions and methods of voice diction control.

Form.ScaleMode Doesn't Work Properly
Hi everybody,
you can tell from this post that I'm an extreme newbie to VB.
I want to do a pretty easy thing, resizing the controls in the form when the user resizes the form.
Here's the code I use:


Code:
Private Sub Form_Resize()

Form1.ScaleMode = 3

With Command1
.Left = 10
.Top = 10
.Width = 100
.Height = Form1.Height / 10
End With

With Picture1
.Left = 10
.Top = Command1.Height + 30
.Width = Form1.Width - 20
.Height = Form1.Height - Command1.Height - 50
End With

Label1.Caption = Form1.Width

End Sub


Label1 gives me a number that is bigger than 10000! I'm pretty sure that Form1.width returns the width in Twips even though I have set the scalemode to 3 (Pixels)

Does anybody have an idea what's going on here?

Thank you for reading

/ Mattis

Array In Form Load Event Doesn't Work!
I have made a form and put 5 Combo Boxes in there.

In the Form Load event, I populated all those Combo Boxes with figures etc..

After that, I stated some arrays and then when I try to run it, it doesnt work. Message comes up saying "Expected Array".

Here is the code:

Private Sub Form_Load()

'Populate the Runway Combo Box

cboRwy.AddItem "Runway 10"
cboRwy.AddItem "Runway 28"
cboRwy.ListIndex = 0

'Populate the Flap Combo Box

cboFlap.AddItem "Flap 5"
cboFlap.AddItem "Flap 15"
cboFlap.ListIndex = 0

'Populate the Wind Combo Box

For W = -10 To 20
cboWind.AddItem (TW) & " Knots"
Next W

cboWind.ListIndex = 10

'Populate the Temperature Combo Box

For T = -10 To 40
cboTemp.AddItem (T)
Next T
cboTemp.ListIndex = 22

'Populate the QNH Combo Box

For Q = 980 To 1050
cboQnh.AddItem (Q)
Next Q
cboQnh.ListIndex = 30

'Populate the EAI Combo Box

cboEAI.AddItem "Anti Ice ON"
cboEAI.AddItem "Anti Ice OFF"
cboEAI.ListIndex = 0


A = -10
For f = 1 To 5
R10F5Array(0, f) = A
Debug.Print R10F5Array(0, f)
A = A + 5
Next

B = -10
For f = 1 To 11
R10F5Array(f, 0) = B
Debug.Print R10F5Array(f, 0)
B = B + 5
Next

'Populate the internal grid array
'for Rwy 10, Flap 5

R10F5Array(1, 1) = 18460
R10F5Array(1, 2) = 19200
R10F5Array(1, 3) = 19850
R10F5Array(1, 4) = 20320
R10F5Array(1, 5) = 20690

R10F5Array(2, 1) = 18350
R10F5Array(2, 2) = 19110
R10F5Array(2, 3) = 19750
R10F5Array(2, 4) = 20240
R10F5Array(2, 5) = 20630

R10F5Array(3, 1) = 18240
R10F5Array(3, 1) = 19020
R10F5Array(3, 1) = 19670
R10F5Array(3, 1) = 20150
R10F5Array(3, 1) = 20570

R10F5Array(4, 1) = 18120
R10F5Array(4, 1) = 18910
R10F5Array(4, 1) = 19570
R10F5Array(4, 1) = 20050
R10F5Array(4, 1) = 20490

etc..

End Sub

Do you know what the problem is?

System Tray Icon Doesn't Work With WebBrowser Control
Hi,

I have a simple VB6 app with a WebBrowser control and have added the System Tray Application from CypherSolutions that I've used loads of times in other apps.

Problem is - whilst the window is visable the right-click option doesn't work on the system tray icon - if I minimise the window - it's ok.

I've uploaded the app to http://www.simonpearce.co.uk/logmeinapp.zip if anyone wants to take on the challenge!

This has been driving me crazy for ages - can anyone shed any light?

Cheers

Simon

Adodb Control Suddenly Doesn't Work... RunTime 91 Error
I have a form in a VB6 project that has Adodc controls on it. I went to add another adodc control but when I tried to reference it, it gave me a Run-time 91 error (object variable or with block variable not set). So I gave the new adodc control the same settings as an old one (old one meaning a control that was on the form already and does work) I am using a ref to a data link file.

So now I have 2 adodc controls that are exactly the same. However, when I run the form, the old control works (meaning I can hit the movenext, moveprevious, etc buttons on the control), but the new adodc control is grayed out and those buttons are inactive.

Any ideas??

Form Resize Limit! I Have The Code! It Doesn't Work When Border = 0 !
In the following way I made a minimum of 3000 twips and a maximum of 7000 twips resize limit beyond which a user cannot resize the form.

Private Sub Form_Resize()
If Width >= 7000 Then
Width = 7000
End If
If Width <= 3000 Then
Width = 3000
End If
End Sub

I also want to make the border = 0 so that the title bar does not show.The above commands works fine if the border is set to sizable but when its set to 0 it does not work. Is there any way I can do it with the border set to 0?

SSTab On ActiveX Control And CmdButton.Cancel =True Doesn't Work
I have a SStab on an UserControl. The UserControl has DefaultCancel = True. Now when you drop that UserControl on a dialog box. The Cancel button on the dialog box has the property Cancel = True.

The Usercontrol has a number of other objects on it. If the focus is on any object even on objects inside the tab, pressing the escape key will work. If the focus is on one of the tabs (of the SSTab,) pressing escape key doesn't do anything. QA and Product management wants it work. How do I do that?

How To Read MS Word File To RTB And Edit It And Save It? The Rtb Control Doesn't Seem To Work. I Am
How to read MS Word file to RTB and edit it and save it? The rtb control doesn't seem to work. I am using VB 6.

Checking Language Doesn't Work. Right Code But It Doesn't Like Me ;-( HELP
Hello together,

I have allready found the Code that I need for my tool, but it doesn't work.


Code:

Option Explicit
Const MODUL = "ClassLocateSettings"

Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long

Private Const LOCALE_USER_DEFAULT = &H400

Private Const LOCALE_ILANGUAGE = &H1 ' language id
Private Const LOCALE_SLANGUAGE = &H2 ' localized name of language
Private Const LOCALE_SENGLANGUAGE = &H1001 ' English name of language
Private Const LOCALE_SABBREVLANGNAME = &H3 ' abbreviated language name
Private Const LOCALE_SNATIVELANGNAME = &H4 ' native name of language
Private Const LOCALE_ICOUNTRY = &H5 ' country code
Private Const LOCALE_SCOUNTRY = &H6 ' localized name of country
Private Const LOCALE_SENGCOUNTRY = &H1002 ' English name of country
Private Const LOCALE_SABBREVCTRYNAME = &H7 ' abbreviated country name
Private Const LOCALE_SNATIVECTRYNAME = &H8 ' native name of country
Private Const LOCALE_IDEFAULTLANGUAGE = &H9 ' default language id
Private Const LOCALE_IDEFAULTCOUNTRY = &HA ' default country code
Private Const LOCALE_IDEFAULTCODEPAGE = &HB ' default code page
When I debug my Code in the Project:


Code:

Private Sub Form_Load()

Dim LocaleSettings As ClassLocaleSettings

LOCALE_ILANGUAGE = &H1 ' language id
LOCALE_SLANGUAGE = &H2 ' localized name of language
LOCALE_SENGLANGUAGE = &H1001 ' English name of language
LOCALE_SABBREVLANGNAME = &H3 ' abbreviated language name
LOCALE_SNATIVELANGNAME = &H4 ' native name of language
Then LOCALE_ILANGUAGE = &H1 gets every time the value 1 and SLANGUAGE the value 2 and SENGLANGUAGE the value 4097.
It isn't interesting, which country settings I have choose. Why doesn't work it?!
What must I do?

THX
BK

Seems Like Msscript Control ".state = Connected" Doesn't Work?
I want the msscript control to act as an event sink in vb6. I have found several references to this on msdn and othe rplaces, but no working examples. In theory, I should be able to do this:

myscriptcontrol.AddObject "mybutton", Command1
myscriptcontrol.Addcode "sub mybutton_Click()" & vbCrLf & _
            "msgbox" & Chr(34) & "button click" & Chr(34) & vbCrLf & "end sub"
myscriptcontrol.State = Connected

Then when Command1 is clicked the event should be passed down to the mybutton_Click through the script control.

But it doesn't work and my work will be much cleaner if I can make it work.

Thanks,
Karl

Resolved - Child Form Control
I have couple of child forms.
I am using .show and .hide while the main form is still open.
Is it correct or are there any better methods?

there are textboxes in both main and child forms.
How to call text.text between these forms?

while child open, I want to freeze/lock main form so that it shouldnot be selected.
How do I do it?

Right-Click Control Menu Doesn't Appear For MDI Form
hi,
   In my application i have a MDI Form. My problem is that if this form is in maximized state the taskbar right click menu doesn't appear. And if it is in minimized state then it appears.
   Why doesn't it behave like a normal window which has its menu always active?

best regards,
Fundoo

How To Move A Form Underneath A Control
Hi to all,

I am having trouble about positioning a certain form underneath a command button. There is a command button if Form 1 and when the user clicks the comand button, Form 2 must appear exactly below that command button. I have tried changing pixels and twips (the form's scalemode) but I can't get it to work. I also tried API's but since I am still a beginner and have found trouble in grasping its ideas. Maybe a little clue and enlightenment would be a big help?

Do I still need to consider about the screen? the parent form? or are there other considerations I have not taken into account of?

Thanks and god bless all.

How To Move Command Button On Form Control
Hi Folks,

I have one command button on on a form. i want to move or drag on the same form using mouse,an body have code for this please help me.

Thanks

MDI-Child Form Hides Behind Main MDI Form When Another MDI Child Form Is Opened
MDI-Child Form Hides behind Main MDI Form when another MDI Child form is opened via code within the first MDIChild form.

All forms are non modal.

Anyone know why this happens?

Even if I click the MDI Parent form on the main blank body. the child for that is open hides behind the Parent MDI Form.

Help Needed In Activex Writing - Want To Move Control On Form
Hello,

I have written a few activex controls so I'm familiar with how its done. But one thing I've never done before that I want to do is to move the control itself on the form its on. For the Usercontrol name, there is no Left or Top properties to it. Is there any way from within the activex code itself I can move the control on its parent form with the Left/Top properties?

Thanks!

User Control Launches Child Form Off-center Even When STartUpPosition Is CenterOwner
I just encountered this interesting bug. Create a simple user control consisting of a button and a form. Clicking on the button should show the form modally. The form's StartUpPosition is CenterOwner.

Build this OCX file and use it in a second project where the user control is placed off-center of the form. Run the program.

When you click on the User Control button on the form, the child form is launched centered to the user control, not the parent form. Any idea how to resolve this?

Bishop

Image Doesn't Move...
I am making this program, where on one form you use the arrow keys to move an image around the form. The problem is it doesn't seem to work.

Code:
Private Sub Form1_KeyDown(KeyCode As Integer, Shift as Integer)

Select Case KeyCode
Case vbKeyUp
'action - Moves image
Case vbKeyRight
'action - Moves image
Case vbKeyLeft
'action - Moves image
Case vbKeyDown
'action - Moves image
End Select

End Sub
What is the problem here? I have tried everything to fix it. I even changed all that Select Case to If-Then but still nothing. I changed to image to a label, command button, shape and a checkbox, but nothing still. I have tried putting breakpoints and this is how they came out...

Code:
Private Sub Form1_KeyDown(KeyCode As Integer, Shift as Integer)

Select Case KeyCode
Case vbKeyUp 'Oddly this breaks on any keypress that is NOT that arrow, hmm.
'This line does not break on any keypress
Case vbKeyRight
'This line does not break on any keypress
Case vbKeyLeft
'This line does not break on any keypress
Case vbKeyDown
'This line does not break on any keypress
End Select

End Sub

I am sooooo confused , I thought it might be a setting with the form or something, because nothing works..

Anyone know what is wrong here??

Cheers,
Tim

Box Doesn't Move When Key Is Pressed.
I used the following code to move a shape in a form and it worked fine:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Select Case KeyCode
Case vbKeyD
Shape1.Left = Shape1.Left + 50
Case vbKeyA
Shape1.Left = Shape1.Left - 50
Case vbKeyW
Shape1.Top = Shape1.Top - 50
Case vbKeyS
Shape1.Top = Shape1.Top + 50
End Select
End Sub

I then wanted to do the same in another project, i coded it but it didn't work. After a while of playing around i copied the code into the new project, but it still didn't work. The Shape is named the same as in the first project.

Why does it not work? Is there a better way to do it?

Thanks GW

RTB Text Doesn't Move
Ok I have an RTB named Mhtml and a menu button named opn. What i'm trying to do is load the text from a file into the rtb. Here's my code.

Code:
Private Sub opn_Click()
CD.ShowOpen
Mhtml.Text = ""
Dim strdata As String
Open CD.FileName For Input As #21
    Do Until EOF(21)
        Line Input #21, strdata
        If Mhtml.Visible = True Then
            Mhtml.Text = Mhtml.Text & strdata
        Else
            main = main & strdata
        End If
    Loop
Close #21
    file = CD.FileName
    Dim fname() As String
    fname = Split(file, "")
    Me.Caption = fname(UBound(fname)) & " ~ SimpleHtml"
End Sub


This loads the text but all on one line and even when you hit return it stays on the one line. any help would be greatly appreciated.



- Zer0 -
The first law of computer programming: The user is a complete idiot.

Move A Minimized MDI Child
Hi there,

I have an MDI form that I want to minimize and automatically move. I can do this manually with the mouse, but I can't do it with the move function. Any help on it would be very appreciated.

API: Move Child Window To The Front
Quickie: I have an MDI app, and, for some reason, it doesn't always move the child to the forefront when I call the form like this:

Form1.Show

I can't remember the API to do this. Can someone share? Thanks.

How Do I Move Between Records In A Child Recordset
I am using data environment in VB6 to implement a simple parent child relationship. I have a customers table(parent) and a orders(child) table and they are defined as parent child nodes in data environment. My question is how do I move between the child records(orders).
Thanks
-Anuj

(RESOLVED)make Mdi Child Regular Form And Then Back To Mdi Child?
I have a MDI parent form that loads several children based on which button on a toolbar the user selects. I also want to provide a menu for the user to view each form individually outside the parent form as a regular form. Is it possible to do? Why? Well in a previous version of my software, users had to select each form individually to update information. I am enhancing the software so that they can update any of the forms in the same place by using mdi parents and children. However, some users are used to the old way and still want that as an option. But when I call the new forms, they load inside the parent form. Help anyone???



Edited by - ziggy2416 on 5/12/2005 7:44:34 AM

Child MDI Form Close - Other Child Forms Repaint/bleed
I have an application that has multiple Child MDI forms.

when one of the child forms are unloaded (by user or by code), another child form becomes 'active' and it repaint's itself.

During the time it takes to repaint, it looks like it resizes it selft, and the outlines of controls (mhtree, etc) appear like ghost windows on the form.

I've tried using LockWindowUpdate, but it doesn't seem to do anything.

Does anyone know what can be done to stop the form from 'ghost painting' itself?

Thanks,

Earl

Activate/Deactivate Event Doesn't Fire When MDI Child
Please someone help me,
my problem is the following:
i had a nice application (it still is), but my boss wanted it to be an MDI Application, I say: 'No problem' and start changing some forms to MDI Child, but now, when my form is MDI Child, it DOESN'T do the (de)activate event, how is that possible?
Any ideas are welcome


Search before you ask - if you don't know where to search, ask before you search

ADODC's Arrows Doesn't Move The DataGrid's Arrow
I have a problem. Consider the table below as my DataGrid and the one below it as the ADODC. . .

------------------------------------------------
=======================
Customer Number Customer Name
> 345 Morrie
333 Mikel
093 Lorna
342 Cass
=======================
|<<|< Customer |>|>>| (<-This is the ADODC bar)
------------------------------------------------

I have connected my ADODC to the DataGrid. I have also connected the ADODC to my database and the DataGrid displays the database's contents just fine. But the thing is, whenever I press the left/right arrows on the ADODC bar, the arrow on the datagrid (>) doesn't move up or down (or in other words, it doesn't jump to the next row). It remains static (it remains on the first row). What could be the problem? The datagrid isn't locked.

Why Doesn't This Work :S
Hey guys, I was wondering why my coding doesn't work :S


Code:
Private Sub Label1_Click()
Form1.BorderStyle = Sizeable
End Sub

It doesn't report any errors, it just doesn't work :S

Sinkquick...

Why This Doesn“t Work?
i“m trying to draw a polygon in a picturebox. can someone help me..
my code is this:

(it“s very similar to the one in the api's example)

thanks all.


Option Explicit

Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As Any, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As Any, ByVal nCount As Long) As Long
Private Declare Function FillRgn Lib "gdi32" (ByVal hdc As Long, ByVal hRgn As Long, ByVal hBrush As Long) As Long
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private MP2(1 To 50, 1 To 2) As Integer
Dim hBrush2 As Long, hRgn2 As Long
Dim s As Integer
Const ALTERNATE = 2 ' ALTERNATE and WINDING are
Const WINDING = 2 ' constants for FillMode.
Const BLACKBRUSH = 1 ' Constant for brush type.


Private Sub Command1_Click()

Picture2.PaintPicture Me.Picture1.Picture, 0, 0, , , , , , , vbSrcAnd

End Sub


Private Sub Picture2_Click()

If s = 50 Then Exit Sub

s = s + 1

MP2(s, 1) = Picture2.CurrentX
MP2(s, 2) = Picture2.CurrentY

Const NUM_POINTS = 50

Dim pts2(1 To NUM_POINTS) As POINTAPI
Dim j As Integer

Picture2.Cls

For j = 1 To s

pts2(j).X = MP(j, 1)
pts2(j).Y = MP(j, 2)

Next j


ForeColor = vbBlue
DrawWidth = 1

Polygon Me.Picture2.hdc, pts2(1), s

hBrush2 = GetStockObject(BLACKBRUSH)
' Creates region to fill with color.
hRgn2 = CreatePolygonRgn(pts2(1), s, ALTERNATE)
' If the creation of the region was successful then color.
If hRgn2 Then FillRgn Me.Picture2.hdc, hRgn2, hBrush2


End Sub

Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Picture2.CurrentX = X
Picture2.CurrentY = Y

End Sub

Why Doesn't It Work?!?!?!?!?!
I looked at my code for 6 days already and haven't found the problem yet. Please can somebody help me?
When I activate it it says that the part I made bold is an invalid call.
Here's the part of the code that's important.

declerations:
Dim DX As DirectX8
Dim D3D As Direct3D8
Dim D3DDevice As Direct3DDevice8
Dim DispMode As D3DDISPLAYMODE

Form activate:
DoEvents
Me.Show
DispMode.Format = DispFormat
DispMode.Height = DispHeight
DispMode.Width = DispWidth
If Initialize_D3D(True, True, MainMovies, DispMode, TLVERTEX, D3DDevice, D3D, DX) = False Then
Quit
MainMovies.Hide
DoEvents
MsgBox "Failed to initialize Direct 3D"
End
End If

Initialize_D3D function:
Function Initialize_D3D(FullScreen As Boolean, Flat As Boolean, FormName As Form, DisplayMode As D3DDISPLAYMODE, VertexMode As Long, D3DDevice As Direct3DDevice8, D3D As Direct3D8, DX As DirectX8, Optional D3DX As D3DX8) As Boolean
On Local Error GoTo ErrHandler

Dim D3Dpp As D3DPRESENT_PARAMETERS
Dim D3DCaps As D3DCAPS8
Dim HAL As Boolean
Dim Check As Integer

If DX Is Nothing Then Set DX = New DirectX8
Set D3DX = New D3DX8
Set D3D = DX.Direct3DCreate
With D3Dpp
.BackBufferWidth = DisplayMode.Width
.BackBufferHeight = DisplayMode.Height
.BackBufferFormat = DisplayMode.Format
.BackBufferCount = 1
.hDeviceWindow = FormName.hWnd
.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC
If FullScreen = True Then
.Windowed = 0
Check = D3D.CheckDeviceType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DisplayMode.Format, DisplayMode.Format, 0)
If Check >= 0 Then
HAL = True
Else
HAL = False
End If
Else
.Windowed = 1
Check = D3D.CheckDeviceType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DisplayMode.Format, DisplayMode.Format, 1)
If Check >= 0 Then
HAL = True
Else
HAL = False
End If
End If
If Flat = True Then
.EnableAutoDepthStencil = 0
Else
.EnableAutoDepthStencil = 1
.AutoDepthStencilFormat = D3DFMT_D16
End If
End With
If HAL = True Then
D3D.GetDeviceCaps D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DCaps
Else
D3D.GetDeviceCaps D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, D3DCaps
End If
If (D3DCaps.DevCaps And D3DDEVCAPS_HWTRANSFORMANDLIGHT) Then
If HAL = True Then
Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, FormName.hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, D3Dpp)
Else
Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, FormName.hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, D3Dpp)
End If
Else
If HAL = True Then
Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, FormName.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3Dpp)
Else
Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, FormName.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3Dpp)
End If
End If

D3DDevice.SetVertexShader VertexMode
If VertexMode = VERTEX Then
D3DDevice.SetRenderState D3DRS_LIGHTING, 1
Else
D3DDevice.SetRenderState D3DRS_LIGHTING, 0
End If
If Flat = True Then
D3DDevice.SetRenderState D3DRS_ZENABLE, 0
Else
D3DDevice.SetRenderState D3DRS_ZENABLE, 1
End If

Initialize_D3D = True
Debug.Print "D3D initialized"

Exit Function
ErrHandler:
Initialize_D3D = False
Debug.Print "Error initializing D3D"
End Function

Why Doesn't This Work?
I'm trying to click on something that is in the lstEmails listbox that is 21 items down and it will then select at item in list1 listbox that is the first item.

If I were to select the 22nd item in the lstEmails listbox, it would then jump 300 down in the list1 listbox.




Code:
List1.ListIndex = (lstEmails.ListIndex - 20) * 300

even this doesn't work:


Code:
List1.ListIndex = lstEmails.ListIndex - 20: List1.ListIndex = List1.ListIndex * 300

Why Doesn't This Work?
Here's the HTML

HTML Code:
<input name="Entity" type="hidden" id="Entity" value="EntityID=140947575;EntityType=User" />
<input name="ImageToUpload" type="file" id="ImageToUpload" lang="de-de" size="24" />
<input name="UploadID" type="hidden" id="UploadID" value="1342777561" />
<input name="ViewImagesURL" type="hidden" id="ViewImagesURL" value="http://www.domain.com/index.cfm?fuseaction=user.uploadphoto" />
<br/>
<input type="submit" name="ButtonUpload" value="Upload" onclick="if (parent.beginUpload) parent.beginUpload();" id="ButtonUpload" />
I'm using:


Code:
command1_click()
wb.document.all("ImageToUpload").Value = "C:Imagesimage.gif")
wb.document.all("ButtonUpload").click
end sub

It doesn't seem to fill in the textbox, however.

Why Doesn't This Work??
Hi all. The problem im having is this, im using the following code in a timer


Code:
If fraconfig.tag = DOB then
caldob.visible = true
else
caldob.visible = false
end if
caldob is always visible... WHY??? i cant understand it. To set the tags i have it set up when certain cmds are pressed it changes the fraconfig.tag....

fraconfig.tag = DOB

etc. any help greatly appreciated

EXE Doesn't Work!!!
hello!!

I have a problem:
I make a project and when I make .exe this .exe doesn't work on a PC that don't have VB...

How can I put the program working, without install VB??

Why Doesn't This Work
ok i have keypreview set to true so why doesn't this code work. i know it will be something stupid.


Code:
If vbKeyDown = vbKeyRight Then
Picture1(0).BackColor = vbRed
End If

My .exe Doesn't Work
I made a small game which used some timers. The game worked fine when it was run in vb but when I made it into a .exe file (using -file - make project.exe) the timers didn't stop when they were supposed to.
Can anyone help
ta


Who needs rhetorical questions?

Why Doesn't It Work!? Value..
Option Explicit
Dim Bredd As Integer
Dim Hojd As Integer
Dim Omkretsen As Integer
Dim Arean As Integer

Public Function Ritas() As Integer
Bredd = Val(txtBredd.Text)
Hojd = Val(txtHojd.Text)
If chkArean.Value = 1 Then
Arean = Bredd * Hojd
lblArean.Caption = "Arean är " & Arean & "mm2"
End If
If chkOmkrets.Value = 1 Then
Omkretsen = Bredd * 2 + Hojd * 2
lblOmkrets.Caption = "Omkretsen är " & Omkretsen & "mm2"
End If
End Function


Private Sub Timer1_Timer()
Ritas
End Sub


This is my project and the label.caption DONT get written WHY I have another form and like the same text and that does work? Why can this work?

Why Doesn't It Work?
Hi. I've recently been working on a music player, Eden 2. It worked fine until I formatted my HD and installed Win 2k Pro (I used to have ME). Since then whenever I run it, it won't play any music - and if I try to play it from the playlist it comes up with an error. Could somebody please work out why it's not working?
Cheers all

Why Doesn't This Work?
Hi

I have a form with 10 labels and 1 button. When the user clicks the button a random number is generated and placed in the first available empty label. The program loops through until all the labels are filled. However, all the labels must be different. So a check is made to see if the random numder generated already exists. If it does the check exits and the loop starts again with a new number and so on. That's the theory but my code doesn't work can you point me in the right direction?

*****************************************

Dim count1, num1 As Integer
----------------------------------------

Private Sub cmdNew_Click()

Dim x As Integer

Randomize

count1 = 0

Do Until count1 = 9

'create a random number
num1 = Int(Rnd() * 10)

For x = 0 To count1

'find a label to put it in
If num1 = Val(Label1(x).Caption) Then

Exit For

Else

Label1(x).Caption = num1
count1 = count1 + 1

End If

Next x

DoEvents

Loop

End Sub

***********
Why bother? I want a simple activity where children can drop and drag numbers into their correct order.

Thanks Paul

Why EOF Doesn't Work?
Hi:

Some of you ask me why I wasn't using EOF in my code, so now I need to ask you, because if I use EOF in the code below, nothing happens, the compiler doesn't retunrs any error message but the code doens't updates the list. Why?

------------

'lstBox Loop:
lstSpaExt.Clear
Dim I As Integer
I = 0
ExtSpa.MoveFirst
Do Until I = ExtSpa.EOF -> 'I was using .RecordCount
I = I + 1
lstSpaExt.AddItem ExtSpa("SpaNum") & ExtSpa("SpaDate")
ExtSpa.MoveNext
Loop

--------------

Very thanks.

This Doesn't Work, Does It???
Code:
strConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=http://ipaddressofsite/shareddatabasefoldername/databasename.mdb"

It Just Doesn't Work!
I followed the "Creating a Simple DataCombo Application" in the MSDN
help. I can't get the values of the DataGrid to change everytime I click
a selection on my DataCombo. I've been working on this problem for days!

How do I change the values in my datagrid when I select an item in my
datacombo?

Please Help me...

Why It Doesn't Work???
Private Sub Form_Load()
Dim Adodc1 As Adodc
Dim connessione As New ADODB.Connection
Dim tabella As New ADODB.Recordset
Dim query As String

connessione = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:Documents and SettingsFreedomDesktopiociprovo.mdb;Persist Security Info=False"

Adodc1.ConnectionString = connessione
Adodc1.RecordSource = connessione
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = localitą

DataGrid1.DataSource = Adodc1

connessione.Open

Set tabella.ActiveConnection = connessione

query = "select localitą from localitą"

tabella.Open query

Do While Not tabella.EOF
risultato = tabella!localitą & Chr(10)
MSFlexGrid1.AddItem risultato
tabella.MoveNext
Loop
End Sub

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