#135246 - 2005-03-10 07:28 PM
Re: Disable Close Button, but allow Minimize
|
dataspike
Getting the hang of it
Registered: 2005-03-09
Posts: 89
Loc: San Diego, CA
|
Yup... Here's the form in question.
Chris
Code:
;*******************************************************************************
;** Main Form
;*******************************************************************************
$frmMain = $System.Form($Root)
$frmMain.ShowInTaskBar = "False"
$frmMain.BorderStyle = 1
$frmMain.SysMenu = 0
$frmMain.ControlBox = 0
$frmMain.Size = 320,310
$frmMain.Text = "Welcome to the @DOMAIN Domain"
$frmMain.Center
$frmMain.TopMost = 1
;*******************************************************************************
;** Logo Picture Frame
;*******************************************************************************
$SPLogoBanner = $frmMain.PictureBox
$SPLogoBanner.BackColor = $frmMain.RGB(255,255,255)
$SPLogoBanner.Left = 5
$SPLogoBanner.Top = 5
$SPLogoBanner.Height = 60
$SPLogoBanner.Width = 300
$SPLogo = $SPLogoBanner.Image
$SPLogo.Picture = $LocalDC + "\netlogon\tucson\logo.bmp"
$SPLogo.Center
$SPLogo.Border = 0
$SPLogo.Height = 52
$SPLogo.Width = 216
;*******************************************************************************
;** User Information GroupBox
;*******************************************************************************
$fraUser = $frmMain.GroupBox
$fraUser.Size = 300,130
$fraUser.Center
$fraUser.Top = 70
$FraUser.Text = "User Information:"
$FullName = @FULLNAME
If InStr($FullName,",") ;If true, then comma found
$NAME_ARRAY = Split($FullName,", ")
$GetFullName = $NAME_ARRAY[1] + " " + $NAME_ARRAY[0]
Else
$GetFullName = $FullName
EndIf
$lblFName = $fraUser.Label("Full Name:",5,22,75,20)
$lblFName.Alignment = 1
$txtFName = $fraUser.TextBox($GetFullName,85,20,205,20)
$txtFName.ReadOnly = 1
$lblUserID = $fraUser.Label("Username:",5,42,75,20)
$lblUserID.Alignment = 1
$txtUserID = $fraUser.TextBox(@USERID,85,40,205,20)
$txtUserID.ReadOnly = 1
$lblLServer = $fraUser.Label("Logon Server:",5,62,75,20)
$lblLServer.Alignment = 1
$txtLServer = $fraUser.TextBox(@LSERVER,85,60,205,20)
$txtLServer.ReadOnly = 1
$lblLDom = $fraUser.Label("Logon Domain:",5,82,75,20)
$lblLDom.Alignment = 1
$txtLDom = $fraUser.TextBox(@DOMAIN,85,80,205,20)
$txtLDom.ReadOnly = 1
$ComputerName = @HOSTNAME
If InStr($ComputerName,".site.com") ;If true, then .site.com found
$Computer_ARRAY = Split($ComputerName,".site.com")
$GetFullCompName = $Computer_ARRAY[0]
Else
$GetFullCompName = $ComputerName
EndIf
$lblComp = $fraUser.Label("Computer:",5,102,75,20)
$lblComp.Alignment = 1
$txtComp = $fraUser.TextBox($GetFullCompName,85,100,205,20)
$txtComp.ReadOnly = 1
; $lblIP = $fraUser.Label("IP Address:",5,122,75,20)
; $lblIP.Alignment = 1
; $txtIP = $fraUser.TextBox($CurrentIP,85,120,205,20)
; $txtIP.ReadOnly = 1
;
; $lblMAC = $fraUser.Label("MAC Address:",5,142,75,20)
; $lblMAC.Alignment = 1
; $txtMAC = $fraUser.TextBox(@ADDRESS,85,140,205,20)
; $txtMAC.ReadOnly = 1
;*******************************************************************************
;** Logon Process GroupBox and ProgressBar
;*******************************************************************************
$fraStatus = $frmMain.GroupBox
$fraStatus.Size = 300,70
$fraStatus.Center
$fraStatus.Top = $fraUser.Bottom + 5
$fraStatus.Text = "Logon Process:"
$lblStatus = $fraStatus.Label("Processing logon script...",10,20,260,20)
$prgStatus = $fraStatus.ProgressBar
$prgStatus.Size = 280,20
$prgStatus.Center
$prgStatus.Top = $lblStatus.Bottom
|
|
Top
|
|
|
|
#135251 - 2005-03-10 08:50 PM
Re: Disable Close Button, but allow Minimize
|
dataspike
Getting the hang of it
Registered: 2005-03-09
Posts: 89
Loc: San Diego, CA
|
Quote:
Did you try searching the mothership www.kixforms.org for the answer?
Believe it or not, but there is a topic there called, of all things, Disable Close button.
Les, if no one has said it before, I will say it now.. you are goood! 
Thanks!
|
|
Top
|
|
|
|
#135253 - 2005-03-10 09:53 PM
Re: Disable Close Button, but allow Minimize
|
dataspike
Getting the hang of it
Registered: 2005-03-09
Posts: 89
Loc: San Diego, CA
|
Haven't updated my code entirely, but this is the one I think I am going to use.
Chris
Code:
Break On $System = CreateObject("Kixtart.System") If VarType($System)<>9 or @ERROR $null=MessageBox("Unable to initialize the KiXforms system namespace!","Error",0) exit 0 Endif
;************* Form ************** $Form = $System.Form() $Form.StartPosition = $System.FormStartPosition.Manual $Form.FormBorderStyle = 1 $Form.Text = "Phone # Finder" $Form.Width = 500 $Form.Height = 165 $Form.ForeColor = 231,223,231 $Form.OnClosing = "SetTaskbar()" $Form.OnResize = "FormResized()" ;**************************************
;************* Label1 ************** $Label1 = $Form.Controls.Label("Enter First or Last Name", 15, 5, 120, 15) ;**************************************
;************* ComboBox1 ************** $ComboBox1 = $Form.Controls.ComboBox("", 135, 3, 120, 20) $ComboBox1.Sorted=1 $ComboBox1.SetFocus ;**************************************
;************* Button1 ************** $Button1 = $Form.Controls.Button("Find", 260, 3, 35, 20) $Button1.Default = 1 $Button1.OnClick = "GetInfo()" ;**************************************
;************* ListViewEx1 ************** $ListViewEx1 = $Form.Controls.ListView("ListViewEx1", 10, 28, 470, 70) $ListViewEx1.AutoArrange = "True" $ListViewEx1.FullRowSelect = "True" $ListViewEx1.HideSelection = "False" $NameColumn = $ListViewEx1.Columns.Add("Name",120,0) $ExtColumn = $ListViewEx1.Columns.Add("Ext",46,0) $PhoneColumn = $ListViewEx1.Columns.Add("Phone",85,0) $LocColumn = $ListViewEx1.Columns.Add("Location",109,0) $DeptColumn = $ListViewEx1.Columns.Add("Dept",89,0) ;**************************************
;************* Menus ************** $Form.Menu = $System.MainMenu() $Form.Menu.Style = 1 $Form.SettingsMenu = $Form.Menu.menuitems.add("File") $Form.TaskMenu = $Form.SettingsMenu.menuitems.add("Run In Taskbar") $Form.TaskMenu.onclick="SetTaskbar()" $Form.ExitMenu = $Form.SettingsMenu.menuitems.add("Exit") $Form.ExitMenu.onclick="$$Form.Hide" ;**************************************
$Form.Show While $Form.Visible or $notifyicon $=Execute($Form.DoEvents()) Loop Exit 1
;********************************* ;************* UDFs ************** ;********************************* FUNCTION SetTaskbar() $Form.TaskMenu.Checked=1 $notifyicon = $System.NotifyIcon() $notifyicon.visible = 1 $notifyicon.text = "Phone # Finder" $notifyicon.icon = $System.BuiltInIcons(5) $notifyicon.OnClick = "UnSetTaskbar()" $form.hide ENDFUNCTION
FUNCTION UnSetTaskbar() $form.Show $form.Activate If $Form.WindowState = $System.FormWindowState.Minimized $Form.WindowState = $System.FormWindowState.Normal Endif $notifyicon.visible = 0 $notifyicon.text = "" $notifyicon = 0 $Form.TaskMenu.Checked=0 ENDFUNCTION
FUNCTION FormResized() If $Form.WindowState = $System.FormWindowState.Minimized SetTaskbar() Endif ENDFUNCTION
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 657 anonymous users online.
|
|
|