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




Popup Menu Doesn't Work


hi all,

popup menu doesn't work after i added bitmaps to it

any solutions ?

waiting for F.B

thanx on advance




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Popup Menu Doesn't Work
Hi there. I am having a problem with my pop up menu. This is extremely irritating!!! Here is a what I am doing:

I have 3 Forms and they have the following hierarchy:

  ParentProviderSearch
     PaymentPlan
        PaymentReceiptList


ParentProviderSearch opens first. The PaymentPlan form is opened from the ParentProviderSearch form. The PaymentPlan form has a list view that lists all the payment plans. When they user right clicks on the list view then a popupmenu appears. From this popup menu they can select "view Payment Recipts". When they user clicks on that menu item, it opens up PaymentReceiptList.

The PaymentReceiptList also has a listview, and when the user right clicks it, it is supposed to diplay a popup menu. THE POPUP MENU DOESN'T APPEAR!!! Does anybody have any clues as to why? The menu is visible so you can see it on top of the form, but it doesn't appear. Please keep in mind that all the 3 forms are opened as vbmodal. I don't know if that has anything to do with it. Please Help!!! This is absolutely ridiculous.

Popup Menu Doesn't Show
Hello ,

i started out with VB , and made a little app , i managed to make a systray icon for it but when i right click the icon it doesn't show a little menu at all but it gives me a error saying " popup menu should have at least one sub menu " . i made the menu with the menu editor as described on the MS help pages but no go . this is the code i got from MS

anybody got a clue what i'm doing wrong ?


Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'this procedure receives the callbacks from the System Tray icon.
Dim Result As Long
Dim msg As Long
'the value of X will vary depending upon the scalemode setting
If Me.ScaleMode = vbPixels Then
msg = X
Else
msg = X / Screen.TwipsPerPixelX
End If
Select Case msg
Case WM_LBUTTONUP '514 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
Case WM_LBUTTONDBLCLK '515 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
Case WM_RBUTTONUP '517 display popup menu
Result = SetForegroundWindow(Me.hwnd)
Me.PopupMenu Me.mPopupSys
End Select
End Sub

Why My New Menu Doesn't Work ?
I made a new COM Addin menu in the Word2000.

When I clicked any menu item which had defined a sub or a function it always pop-up the message "The macro cannot be found or has been disbled because of your Macro security seetings." whatever in the debugging model or running.

But I had set the Tools-Macor-Security... to low and selected 'trust all installed addin'.

So I cannot do anything.

Thanks.

Non Visable Menu Doesn't Work???
I have a menu with two sub menu's. The main menu is not visble. But when I use the shortcuts the command doesn't activate for either of them

If you make it visable it works
I dont want it visable, how do you fix this ????

Why When Menu Item Not Visible, Shortcut Doesn't Work .. ?
Is there a reason why if a menu (main item) isn't visible that it's sibling/child items shortcut keys won't work ? I have a custom context menu with key shortcuts but as it's not visible in the main menu (at the top of the form) the shortcuts don't work. When I do leave the context menu visible in the form the shortcuts work fine. If anyone could please explain the reason behind this or offer a solution to get around this problem it would be greatly appriciated.

Thanks,

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)))

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

Quickie Popup Menu - TextBox Popup Inhibit
I did a quick popup menu (a four item listbox) for a stand-alone form
(no MDI parent). I want it to respond to a right-click, but it gets
overlaid by the Textbox popup menu.

How can I inhibit the Textbox popup?

Thanks,
John

"mDoc.getElementById("menu").innerHTML = S" Doesn´t Work! 'PLEASE Help!!!!!!!
I have a html document with two iframes in and I want to write in an new html document that is encypted in the iFrame that has the id="menu". The new html document have a read in from a file and decrypted it and load it in to a variable s. I have try the vb code down below but i get en "Run-time error 600" "Application-defined or object-defined error. Could any one help me? I want to take the content that is in "s" (html-code) and load that in the iFrame "menu"


Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="CSS/base.css" type="text/css">
<script type="text/javascript" language="javascript" src="Javascript/base.js"></script>

</head>

<body onLoad="javascript:init()">

<div id="globalcontainer">

<div id="header">
<ul>
<li id="current"><a href="#" onClick="activateTab(this.parentNode, 'home')">Home</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'channels')">Channels</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'diagnosis')">Diagnosis and treatment</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'glossary')">Glossary</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'needling')">Needling</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'pointCat')">Point categorie</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'pointindex')">Point index</a></li>
<!--<li><a href="#" onClick="activateTab(this.parentNode, 'methods')">Point selection methods</a></li>-->
</ul>
</div>
<br style="clear:left"/>
<span class="style1"></span>

<div id="box">
<iframe name="menu" id="menu" width="595" height="100" src="Menu/mHome.htm" frameborder="0"></iframe>
</div >

<div id="view">
<iframe name="show" id="show" src="data/home.htm" width="595" height="475"></iframe>
</div>

</div>

</body>
</html>



This is the VB-Code that i try with


VB Code:
Dim s As string Set mDoc = WebBrowser1.Document Set txtStream = mFso.GetFile("C:akuSourceMenumChannels.htm").OpenAsTextStream(ForReading) s = txtStream.ReadAll mDoc.getElementById("menu").innerHTML = s



This is all the VB code in the sub




VB Code:
Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, _            Headers As Variant, Cancel As Boolean)          Dim Ev As String         Dim txtStream As TextStream         Dim strElement As String         Dim i As Integer                           Set mDoc = WebBrowser1.Document                                      If UCase$(Left$(URL, 6)) = "EVENT:" Then               'this is our event, process it and cancel navigation               Ev = UCase$(Mid$(URL, 7))                              Call MsgBox(Ev)               Select Case Ev                   Case "HELLO"                       MsgBox "Hello from VB App"                       'set a field on HTML page                       WebBrowser1.Document.All("field1").Value = _                           "Hello from VB"                    Case "CLOSE"                       If MsgBox("Are you sure you want to exit?", _                   vbYesNo) = vbYes Then                           End                       End If                                        Case "CHANNELS"                                      Set txtStream = mFso.GetFile("C:AkupunktörAkupunktör_klientSourceMenumChannels.htm").OpenAsTextStream(ForReading)                     s = txtStream.ReadAll                                          Dim frames As HTMLElementCollection                     Dim frame As HTMLIFrame                           'Set frame = mDoc.getElementsByTagName("iframe")                                      'WebBrowser1.Document.getElementById ("box")                      'For Each frame In frames                    ' If frame.Name = "box" Then                             'Set getMainWindow = frame                             'Exit For                          ' Call MsgBox("Hej")                    ' End If                    ' Next                                                      Dim strOuter As String                     Dim o, oFrame As Object                     Set o = mDoc.frames                         ' For i = 0 To o.length - 1               ' Debug.Print "Frame:" & i & o(i).Name                ' Set oFrame = o(i)                '' Debug.Print "Frame:" & i & oFrame.Name                                         ' Next i                     'mDoc.frames(0).innerHTML = s                      mDoc.getElementById("menu").innerHTML = s                                           'MsgBox (mDoc.getElementsByName()                                          ' myFrame.innerHTML = s                     'WebBrowser1.Document.getElementById("menu").innerHTML = s                                                'Call MsgBox(mIframe)                                                                          End Select               Cancel = True           End If       End Sub

"mDoc.getElementById("menu").innerHTML = S" Doesn&#180;t Work! 'PLEASE Help!!!!!!!
I have a html document with two iframes in and I want to write in an new html document that is encypted in the iFrame that has the id="menu". The new html document have a read in from a file and decrypted it and load it in to a variable s. I have try the vb code down below but i get en "Run-time error 600" "Application-defined or object-defined error. Could any one help me? I want to take the content that is in "s" (html-code) and load that in the iFrame "menu"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="CSS/base.css" type="text/css">
<script type="text/javascript" language="javascript" src="Javascript/base.js"></script>

</head>

<body onLoad="javascript:init()">

<div id="globalcontainer">
    
    <div id="header">
        <ul>
            <li id="current"><a href="#" onClick="activateTab(this.parentNode, 'home')">Home</a></li>
            <li><a href="#" onClick="activateTab(this.parentNode, 'channels')">Channels</a></li>
            <li><a href="#" onClick="activateTab(this.parentNode, 'diagnosis')">Diagnosis and treatment</a></li>
            <li><a href="#" onClick="activateTab(this.parentNode, 'glossary')">Glossary</a></li>
            <li><a href="#" onClick="activateTab(this.parentNode, 'needling')">Needling</a></li>
            <li><a href="#" onClick="activateTab(this.parentNode, 'pointCat')">Point categorie</a></li>
            <li><a href="#" onClick="activateTab(this.parentNode, 'pointindex')">Point index</a></li>
            <!--<li><a href="#" onClick="activateTab(this.parentNode, 'methods')">Point selection methods</a></li>-->
        </ul>
    </div>
    <br style="clear:left"/>
    <span class="style1"></span>
    
    <div id="box">
        <iframe name="menu" id="menu" width="595" height="100" src="Menu/mHome.htm" frameborder="0"></iframe>
    </div >
  
    <div id="view">
        <iframe name="show" id="show" src="data/home.htm" width="595" height="475"></iframe>
      </div>
    
</div>
    
</body>
</html>



This is the VB-Code that i try with

Dim s As string
Set mDoc = WebBrowser1.Document
Set txtStream = mFso.GetFile("C:akuSourceMenumChannels.htm").OpenAsTextStream(ForReading)
s = txtStream.ReadAll
mDoc.getElementById("menu").innerHTML = s



This is all the VB code in the sub



Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, _
           Headers As Variant, Cancel As Boolean)

        Dim Ev As String
        Dim txtStream As TextStream
        Dim strElement As String
        Dim i As Integer
        
        
        Set mDoc = WebBrowser1.Document
        
        
        
          If UCase$(Left$(URL, 6)) = "EVENT:" Then
              'this is our event, process it and cancel navigation
              Ev = UCase$(Mid$(URL, 7))
              
              Call MsgBox(Ev)
              Select Case Ev
                  Case "HELLO"
                      MsgBox "Hello from VB App"
                      'set a field on HTML page
                      WebBrowser1.Document.All("field1").Value = _
                          "Hello from VB"

                  Case "CLOSE"
                      If MsgBox("Are you sure you want to exit?", _
                  vbYesNo) = vbYes Then
                          End
                      End If
                      
                Case "CHANNELS"
                
                    Set txtStream = mFso.GetFile("C:AkupunktörAkupunktör_klientSourceMenumChannels.htm").OpenAsTextStream(ForReading)
                    s = txtStream.ReadAll
                    
                    Dim frames As HTMLElementCollection
                    Dim frame As HTMLIFrame
     
                    'Set frame = mDoc.getElementsByTagName("iframe")
                
                    'WebBrowser1.Document.getElementById ("box")
                     'For Each frame In frames
                   ' If frame.Name = "box" Then
                            'Set getMainWindow = frame
                            'Exit For
                         ' Call MsgBox("Hej")
                   ' End If
                   ' Next
               
                
                    Dim strOuter As String
                    Dim o, oFrame As Object
                    Set o = mDoc.frames
    
    
              ' For i = 0 To o.length - 1
              ' Debug.Print "Frame:" & i & o(i).Name
               ' Set oFrame = o(i)
               '' Debug.Print "Frame:" & i & oFrame.Name
                        
               ' Next i
                    'mDoc.frames(0).innerHTML = s
                     mDoc.getElementById("menu").innerHTML = s
                    
                     'MsgBox (mDoc.getElementsByName()
                     
                   ' myFrame.innerHTML = s
                    'WebBrowser1.Document.getElementById("menu").innerHTML = s
     
                    
                    'Call MsgBox(mIframe)
                    
                  
                  
              End Select
              Cancel = True
          End If
      End Sub



Edited by - wolf67 on 3/4/2005 3:05:53 AM

"mDoc.getElementById("menu").innerHTML = S" Doesn´t Work! 'PLEASE Help!!!!!!!
I have a html document with two iframes in and I want to write in an new html document that is encypted in the iFrame that has the id="menu". The new html document have a read in from a file and decrypted it and load it in to a variable s. I have try the vb code down below but i get en "Run-time error 600" "Application-defined or object-defined error. Could any one help me? I want to take the content that is in "s" (html-code) and load that in the iFrame "menu"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="CSS/base.css" type="text/css">
<script type="text/javascript" language="javascript" src="Javascript/base.js"></script>

</head>

<body onLoad="javascript:init()">

<div id="globalcontainer">

<div id="header">
<ul>
<li id="current"><a href="#" onClick="activateTab(this.parentNode, 'home')">Home</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'channels')">Channels</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'diagnosis')">Diagnosis and treatment</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'glossary')">Glossary</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'needling')">Needling</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'pointCat')">Point categorie</a></li>
<li><a href="#" onClick="activateTab(this.parentNode, 'pointindex')">Point index</a></li>
<!--<li><a href="#" onClick="activateTab(this.parentNode, 'methods')">Point selection methods</a></li>-->
</ul>
</div>
<br style="clear:left"/>
<span class="style1"></span>

<div id="box">
<iframe name="menu" id="menu" width="595" height="100" src="Menu/mHome.htm" frameborder="0"></iframe>
</div >

<div id="view">
<iframe name="show" id="show" src="data/home.htm" width="595" height="475"></iframe>
</div>

</div>

</body>
</html>



This is the VB-Code that i try with

Dim s As string
Set mDoc = WebBrowser1.Document
Set txtStream = mFso.GetFile("C:akuSourceMenumChannels.htm").OpenAsTextStream(ForReading)
s = txtStream.ReadAll
mDoc.getElementById("menu").innerHTML = s



This is all the VB code in the sub



Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, _
Headers As Variant, Cancel As Boolean)

Dim Ev As String
Dim txtStream As TextStream
Dim strElement As String
Dim i As Integer


Set mDoc = WebBrowser1.Document



If UCase$(Left$(URL, 6)) = "EVENT:" Then
'this is our event, process it and cancel navigation
Ev = UCase$(Mid$(URL, 7))

Call MsgBox(Ev)
Select Case Ev
Case "HELLO"
MsgBox "Hello from VB App"
'set a field on HTML page
WebBrowser1.Document.All("field1").Value = _
"Hello from VB"

Case "CLOSE"
If MsgBox("Are you sure you want to exit?", _
vbYesNo) = vbYes Then
End
End If

Case "CHANNELS"

Set txtStream = mFso.GetFile("C:AkupunktörAkupunktör_klientSourceMenumChannels.htm").OpenAsTextStream(ForReading)
s = txtStream.ReadAll

Dim frames As HTMLElementCollection
Dim frame As HTMLIFrame

'Set frame = mDoc.getElementsByTagName("iframe")

'WebBrowser1.Document.getElementById ("box")
'For Each frame In frames
' If frame.Name = "box" Then
'Set getMainWindow = frame
'Exit For
' Call MsgBox("Hej")
' End If
' Next


Dim strOuter As String
Dim o, oFrame As Object
Set o = mDoc.frames


' For i = 0 To o.length - 1
' Debug.Print "Frame:" & i & o(i).Name
' Set oFrame = o(i)
'' Debug.Print "Frame:" & i & oFrame.Name

' Next i
'mDoc.frames(0).innerHTML = s
mDoc.getElementById("menu").innerHTML = s

'MsgBox (mDoc.getElementsByName()

' myFrame.innerHTML = s
'WebBrowser1.Document.getElementById("menu").innerHTML = s


'Call MsgBox(mIframe)



End Select
Cancel = True
End If
End Sub

Making A Popup Menu, Popup A Menu
Hi

I have a popupmenu that gets used extensivly in my app. On every menu item that is clicked, a new submenu should be shown, but i need to reuse that submenu over and over again on most of my menu items.

So what i thought was making another menu that will act as the submenu that needs to be shown, and calling


VB Code:
Private Sub mnuOpen_Click()   '-- Need this menu to popup another menu   Me.PopupMenu Me.mnuSubmenuEnd Sub


But that simply doesnt work


Any thoughts on how i can do this?

Thanks

How To Popup A Menu For The Menu Created By MenuEditor && Populated At Runtime On RCli
How to Popup a Menu for the Menu created by MenuEditor & populated at runtime, the Popup should be shown when the user right click the Menu.

Hi,

I need to show the PopuMenu for populated Menu, either its created by API as below or by MenuObject. The below
is the way i created the Menu through API based on the sample of ROB in this Forum.

The below is the code in the General Declaration Section in the Form.


VB Code:
Const MF_CHECKED = &H8&Const MF_APPEND = &H100&Const TPM_LEFTALIGN = &H0&Const MF_DISABLED = &H2&Const MF_GRAYED = &H1&Const MF_SEPARATOR = &H800&Const MF_STRING = &H0&Private Type POINTAPI    X As Long    Y As LongEnd TypePrivate Declare Function CreatePopupMenu Lib "user32" () As LongPrivate Declare Function TrackPopupMenu Lib "user32" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal X As Long, ByVal Y As Long, ByVal nReserved As Long, ByVal hwnd As Long, ByVal lprc As Any) As LongPrivate Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As LongPrivate Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As LongPrivate Declare Function DestroyMenu Lib "user32" (ByVal hMenu As Long) As LongPrivate Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongDim hMenu As Long Private Type MSG    hwnd As Long    message As Long    wParam As Long    lParam As Long    time As Long    pt As POINTAPIEnd Type


I am using a Grid control, that is populated at runtime with AreaName, In that GridControl's MouseUp Event, I
am loading the Equipment for the Cicked Area is populated and displayed in a Menu and shown to the user. By using
the below code. It works fine. All Equipments are added to the Menu created by the Menu Editor at runtime.


VB Code:
Private Sub JanfpSpr_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)    Dim CurSprVal As Variant    Dim DtVal As Variant    Dim oMenu As Menu    Dim rstSi As New ADODB.Recordset    Dim ShtType As String    Dim JanCritTyp As Variant        If Button = vbLeftButton Then        JanfpSpr.GetText 4, JanfpSpr.ActiveRow, JanCritTyp        JanfpSpr.GetText 1, JanfpSpr.ActiveRow, CurSprVal        JanfpSpr.GetText 3, JanfpSpr.ActiveRow, DtVal                ShtType = Mid(CurSprVal, Len(CurSprVal) - 4, Len(CurSprVal))        CurSprVal = Mid(CurSprVal, 1, Len(CurSprVal) - 9)                If JanCritTyp = "Area" Then                SQL = "select * from EquipMaster where ArName='" & Mid(CurSprVal, 7, Len(CurSprVal)) & "' And Nextti Between #" & DtVal & "# And #" & DtVal & "# And ShtTp='" & ShtType & "' order by ENo"                If rstSi.State = 1 Then rstSi.Close                rstSi.Open SQL, cnnNew, adOpenStatic, adLockReadOnly, adCmdText                Call UnloadMenuItems                mnuLstSubItms(0).Caption = Mid(CurSprVal, 7, Len(CurSprVal))                mnuLstSubItms(0).Enabled = False                            While Not rstSi.EOF                    Load mnuLstSubItms(mnuLstSubItms.Count + 1)                    mnuLstSubItms(mnuLstSubItms.UBound).Caption = rstSi.Fields("ENo")                    mnuLstSubItms(mnuLstSubItms.UBound).Enabled = True                    rstSi.MoveNext                Wend                mnuLstEqp.Enabled = True                Call PopupMenu(mnuInfo)        ElseIf JanCritTyp = "Equipment" Then               Call UnloadMenuItems               mnuLstEqp.Enabled = False               Call PopupMenu(mnuInfo)        End If    End If'    End IfEnd Sub

Just in the Above code I added the Equipment Names in the Menu, If the User Right Click any
1 of the Equipment from the Menu then i need to show a Popup Menu with Update,Report etc.
for this Popup from the Equipment I added the Below Code in Form_Load() and mnuLstSubItms_Click()


VB Code:
Private Sub Form_Load()    hMenu = CreatePopupMenu()    AppendMenu hMenu, MF_STRING, ByVal 0&, "&Update"        AppendMenu hMenu, MF_SEPARATOR, ByVal 0&, ByVal 0&        AppendMenu hMenu, MF_STRING, ByVal 0&, "&Delete"        AppendMenu hMenu, MF_SEPARATOR, ByVal 0&, ByVal 0&        AppendMenu hMenu, MF_STRING, ByVal 0&, "&Report"End Sub Private Sub mnuLstSubItms_Click(Index As Integer)    Dim pt As POINTAPI    GetCursorPos pt    TrackPopupMenu hMenu, TPM_LEFTALIGN, pt.X, pt.Y, 0, Me.hwnd, ByVal 0&End Sub


What happens for this code is, The Popup menu is Show, but as soon as this Popup Menu is shown
the existing PopuMenu disappears, i need both to be visible as we can see in Windows Menus

Requirements:

How to find which MouseButton is Clicked in the mnuLstSubItms_Click Event.
How to and where to write the Events for the PopupMenu created through API (for Menu Update,Report)
How to protect without the Menu disappears, when the user right click the Equipment.

As (Moderator) Rob said i posted here this issue in the New Thread. Hope any VBForums member
might have faced the same scenario. Kindly check this and reply me.

The picture of the Menus on runtime and design time are also attached here for your reference.

Thankyou,
Chock.

How To Popup A Menu For The Menu Created By MenuEditor && Populated At Runtime
How to Popup a Menu for the Menu created by MenuEditor & populated at runtime, the Popup should be shown when the user right click the Menu.

Hi,

I need to show the PopuMenu for populated Menu, either its created by API as below or by MenuObject. The below is the way i created the Menu through API based on a sample given in VBForums by Rob.

My Project Current status.
The below is the code in the General Declaration Section in the Form.

Code:

Const MF_CHECKED = &H8&
Const MF_APPEND = &H100&Const TPM_LEFTALIGN = &H0&
Const MF_DISABLED = &H2&
Const MF_GRAYED = &H1&
Const MF_SEPARATOR = &H800&Const MF_STRING = &H0&
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function CreatePopupMenu Lib "user32" () As Long
Private Declare Function TrackPopupMenu Lib "user32" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal X As Long, ByVal Y As Long, ByVal nReserved As Long, ByVal hwnd As Long, ByVal lprc As Any) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Private Declare Function DestroyMenu Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Dim hMenu As Long

Private Type MSG
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type

I am using a Grid control, that is populated at runtime with AreaName, In that GridControl's MouseUp Event, I am loading the Equipment for the Cicked Area is populated and displayed in a Menu and shown to the user. By using the below code. It works fine. All Equipments are added to the Menu created by the Menu Editor at runtime.

Code:

Private Sub JanfpSpr_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim CurSprVal As Variant
Dim DtVal As Variant
Dim oMenu As Menu
Dim rstSi As New ADODB.Recordset
Dim ShtType As String
Dim JanCritTyp As Variant

If Button = vbLeftButton Then
JanfpSpr.GetText 4, JanfpSpr.ActiveRow, JanCritTyp
JanfpSpr.GetText 1, JanfpSpr.ActiveRow, CurSprVal
JanfpSpr.GetText 3, JanfpSpr.ActiveRow, DtVal

ShtType = Mid(CurSprVal, Len(CurSprVal) - 4, Len(CurSprVal))
CurSprVal = Mid(CurSprVal, 1, Len(CurSprVal) - 9)

If JanCritTyp = "Area" Then
SQL = "select * from EquipMaster where ArName='" & Mid(CurSprVal, 7, Len(CurSprVal)) & "' And Nextti Between #" & DtVal & "# And #" & DtVal & "# And ShtTp='" & ShtType & "' order by ENo"
If rstSi.State = 1 Then rstSi.Close
rstSi.Open SQL, cnnNew, adOpenStatic, adLockReadOnly, adCmdText
Call UnloadMenuItems
mnuLstSubItms(0).Caption = Mid(CurSprVal, 7, Len(CurSprVal))
mnuLstSubItms(0).Enabled = False

While Not rstSi.EOF
Load mnuLstSubItms(mnuLstSubItms.Count + 1)
mnuLstSubItms(mnuLstSubItms.UBound).Caption = rstSi.Fields("ENo")
mnuLstSubItms(mnuLstSubItms.UBound).Enabled = True
rstSi.MoveNext
Wend
mnuLstEqp.Enabled = True
Call PopupMenu(mnuInfo)
ElseIf JanCritTyp = "Equipment" Then
Call UnloadMenuItems
mnuLstEqp.Enabled = False
Call PopupMenu(mnuInfo)
End If
End If
' End If
End Sub

Just in the Above code I added the Equipment Names in the Menu, If the User Right Click any 1 of the Equipment from the Menu then i need to show a Popup Menu with Update,Report etc. for this Popup from the Equipment I added the Below Code in Form_Load() and mnuLstSubItms_Click()

Code:

Private Sub Form_Load()
hMenu = CreatePopupMenu()
AppendMenu hMenu, MF_STRING, ByVal 0&, "&Update"
AppendMenu hMenu, MF_SEPARATOR, ByVal 0&, ByVal 0&
AppendMenu hMenu, MF_STRING, ByVal 0&, "&Delete"
AppendMenu hMenu, MF_SEPARATOR, ByVal 0&, ByVal 0&
AppendMenu hMenu, MF_STRING, ByVal 0&, "&Report"
End Sub

Private Sub mnuLstSubItms_Click(Index As Integer)
Dim pt As POINTAPI
GetCursorPos pt
TrackPopupMenu hMenu, TPM_LEFTALIGN, pt.X, pt.Y, 0, Me.hwnd, ByVal 0&
End Sub

What happens for this code is, The Popup menu is Show, but as soon as this Popup Menu is shown
the existing PopuMenu disappears, i need both to be visible as we can see in Windows Menus


Requirements:

How to find which MouseButton is Clicked in the mnuLstSubItms_Click Event.
How to and where to write the Events for the PopupMenu created through API (for Menu Update,Report)
How to protect without the Menu disappears, when the user right click the Equipment.

Hope any member here might have faced the same scenario. Kindly check this and reply me.

The picture of the Menus on runtime and design time are also attached here for your reference.

Thankyou,
Chock.

Popup Menu, Context Menu Dynamic Creation?
Hi everyone,

i used the google search and the forum search but i didnt find any suitable result.
What i want to do:
i want to display a popup menu which is dynamic created from an xml file. i read the xml file to my own private type structure and now i want to display a popup menu. the only, as i think very ugly way i found is sevpopup menu active x. the problem with that menu is, that in every way there is a space for icons in menu which i dont have and the other problem is that i want to copy and not to install the application.
Really important for me is that i can create submenus!

Thank you all for help!

buechse

How To Add A Menu Item To The Windows Explorer Popup Menu?
Hi,

I have a feeling that this is going to be an API question, but I thought I start with this forum first..

Basically, what I want to do is to create a little VB app which I can launch by using the popup menu in the Windows Explorer. When I right-click on a folder, I want to be able to launch my program.

Any examples and ideas on how to do this would be greatly appreciated..

Dan

Hide Menu Line When Creating Popup Menu
I have a program that I created a PopupMenu for so when the user does a right click - there are options they can select.

The question is :
In order to create the PopupMenu, I created a menu for my form and then made parent for the menu options disabled and not visible.
When the form is launched however there is a seperation line where a menu should be.
Is there a way to remove this ?

Thanks in advance,
Kflasph

In A Popup Menu Witch Menu Item Is Slected
How do I find out what menu item was clicked

str = popMenu.Name
Select Case str
Case "mCut"
MsgBox "cut"
Case "mPaste"
MsgBox "paste"
Case "mProperties"
MsgBox "pro"

End Select

Balloon Tip Doesn't Popup In Systray
I can't popup ballons in Systray, here an example: Add Your App to the Systray the Easy Way
That's a simple app that should popup a ballon Tip in Systray, but it doesn't work for me. I'm using a wide Screen Monitor (1400 * 900), maybe this is the reason?

Popup (right-click) Menu From Standard Menu
I've searched and searched and cannot find any information on how to get a pop-up menu to appear when you right-click on a standard menu item. A classic example of this is in Internet Explorer's Favorites menu. If you right-click on a favorite, a popup menu appears and you can rename, delete, etc. the highlighted favorite. In VB6, accessing a menu item does not appear to fire the MouseUp or MouseDown events. Any thoughts?

Coding A Popup Menu Instead Of Using Menu Editor :S
Ok this might sound wierd but i want to add pop up menus to my form without using the menu editor and without showing them in the form itself (only when i want them to pop up). I have a frameless form and as soon as i add menus the frame will be there again. and i hoped i could just program a menu that is also pretty editable of some sort

How Do I Design A Context Menu (Popup Menu) In VB?
Hi,

I want to design a popup menu for a form in VB. I already have a menu for the form. This menu is displayed below the title bar. When I try to use the Menu Editor, it only lets me edit this menu. I want to design a new menu which will popup like a context menu. How do I do this?

Any help would be greatly appreciated.

Popup Menu When There's Already A Menu Up Top &lt;/RESOLVED&gt;
I've previously added the code to get a Popup Menu on right-clicking a listbox, but that time it was the only menu on the form.

Is there a way to get two menus on my form or am I going to have to make another form and use it for the popup menu?

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

Use Rec![ + Var + ] Doesn't Work
hi folks,

i want to use:


Code:
If db.rec![ & Globals.zoekterm & ] = Globals.zoekwaarde Then

only this doesn't work is there a way of doing this cause otherwise i have to make an if-statement with 20 choices and with this i can let i be one.

Sql Doesn't Work Right
I have a database with over 1500 records. 5 of those records have the IsThanksDue checkbox checked. They also have the IsFirstDonation checkbox checked. Below is the end of my sql statement. I should have no records returned, right! But every record is returned. Why?

where IsThanksDue=true & IsFirstDonation=false"

It Doesn't Work, Why?
Hi,

I want to "cast" an existing colum from int to long.
I've written this few lines:

...
Dim strSQL As String
Dim dbn As Database
Dim rs As Recordset
Dim Stringa As String

Set dbn = OpenDatabase(Database)
strSQL = "ALTER TABLE " & Tabella & " ALTER COLUMN " & Campo & " LONG"

dbn.Execute strSQL
dbn.Close
Set dbn = Nothing
...

When I run this code VB tell me:

"Run time error 3293: syntax error on ALTER TABLE instruction"

Why?
Thanks

Why Doesn't This Work?
Do
FirstDate = InputBox("Enter the first date", "First Date", "05/04/2000")

LastDate = InputBox("Enter the last date", "Last Date", "04/04/2000")

Loop Until IsDate(FirstDate) = True And IsDate(LastDate) = True

When I enter an invalid date in the first box it goes crazy. How can I get it not to freeze when something invalid is entered.
FirstDate and LastDate are dim as date. Please help asap

This Should Work. But It Doesn't.
Why doesn't


Code:
SetThreadAffinityMask GetCurrentProcess(), &O1


work? I want to simply change the program's affinity to Core1, but it won't!

When I use


Code:
Print GetCurrentProcess()


I get a value of -1, but when I use


Code:
GetProcessAffinityMask GetCurrentProcess, a, b


It gives me the right values in a and b (1, 3, 5, or 15 and 15)

Why can I not set it's affinity?

Why It Doesn't Work?
Pls help me to solve this problem.

I started a project in which I have to crate a list (lista) of numbers thru Access. This list I formed with just one column with a primary key. This list must be read (while...wend?) informing +,-,* and / . So it doen't work and doen't show the error.
Just to know. As the project is in Portuguese (Brazil) some words are in my language.
Bancodados=database
lista=list
valor=value
Abrir=open
Soma= " + "
Subtracao= " - "
Multiplicacao= " * "
Divisao= " / "

Option Explicit
Dim Areadados As Database
Dim Lista As Recordset
Dim soma, subtracao, multiplicacao As Integer
Dim divisao As Currency
Dim total As Currency

Public Sub Abrir_Bancodados()
Set Areadados = DBEngine.Workspaces(0).Opendatabase(App.Path & "MSF.mdb")
Set Lista = Areadados.OpenRecordset("Lista", dbOpentable)
Lista.Index = "PrimaryKey"
End Sub

Private Sub cmdoksoma_Click()
Call Abrir_Bancodados
total = 0
While Not Lista.EOF
If Lista("numeros") = 1 Then
total = total + soma("valor")
End If
Lista.MoveNext
Wend
Lbresposta.Caption = total
End Sub


Thanks a helluvalot

Why It Doesn't Work Me
Hi All

such problem i have something like this


VB Code:
Private Sub Command4_Click()Dim SomeText As String, a As Long, n As StringSomeText = "255.127.64.2"n = Split(SomeText, ".") For a = 0 To UBound(n)   MsgBox n(a)Next aEnd Sub


error chucks out me on line


VB Code:
For a = 0 To UBound(n)


it highlights me >> UBound and it notifies Expected array

????????????? what it's this?
thanks in advance

Why Doesn't This Work?
VB Code:
Private Sub Form_Load() File1.Pattern = ".txt"File1.Path = "c:XXDownloaded" On Error Resume Next For X = 0 To File1.ListCount - 1 Kill File1.Path & "" & File1.Index(X) Next X End Sub


Note: I am trying to delete text files but it won't work

Doesn't Seem To Work...
can anyone work out why this doesn't work?


VB Code:
Private Sub txtSend_Change()If (txtSend >= 2) ThensckSend.SendData txtNick.Text & " Is Typing A Message" & Chr$(13) & Chr$(10)End IfEnd Sub


it's meant to send that message when more than two letters have been changed

Why Doesn´t This Work?
I´m adding some foldernames to a combobox and trying to strip off everything before the "." and then add the extension to a label. I have (in this case) two folders in my combobox which are named "model.cfm" and "model.iae".
This code will only add "iae" to my label.
Why is that?

Frank


VB Code:
Private Sub Combo4_Click()Dim i As IntegerDim theArrayDim theExtensionFor i = 0 To Combo4.ListCount - 1theArray = Split(Combo4.List(i), ".")theExtension = theArray(1)Label5.Caption = "model=" & theExtensionNext iEnd Sub

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