
dynamic_sysop
Leaders
-
Posts
1044 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by dynamic_sysop
-
Killing Excel Instance in ASP.NET
dynamic_sysop
replied to prathalye's topic in Interoperation / Office Integration
here's 2 articles , both are on this same page list lower down... excel staying open1 excel staying open2 -
cheers divil :) these forums keep me smiling, makes me feel like i can do something if i help others , even if it's only a little bit of help.
-
you could always do this : TextBox1.Focus() SendKeys.Send("{BACKSPACE}")
-
have you tried LBound & UBound? to prevent " out of range " eg: Dim x As Integer For x = LBound(parts) To UBound(parts) '/// do your stuff to parts(x) Next
-
in the button_Click event : Dim frmMaint As New Maintenace() frmMaint.Show() '/// assuming that Maintenace is the name of the Form. '/// same for the other form.
-
Well , I was a Photocopier and Fax engineer for 15 years for Toshiba. but i have severe health problems and cannot work , so as of last year i am retired through illness. I only started with vb6 around 18 months ago to help me take my mind off things, then moved on to vb.net and now C# also, now i find that helping out on vbforums gets me through the days ( and obviously my family ). on the odd ocassions that i'm not sat here, i like to play the guitar and might take up fishing again at some point. but in 3 weeks to the day we will have a couple of new additions to the family , so the pc will sit on the backburner for a while i think :)
-
can you not do this.... ( it works for me ) .... Private myCondition As Boolean '/// boolean is just an example here. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not myCondition Then '/// your stuff here , eg: if something equals a value or not. Me.Dispose() End If End Sub
-
have you modified the Sub New? eg: #Region " Windows Form Designer generated code " Public Sub New() '/// has anything been added in here./// MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub i've seen that happen if the starting form has it's Sub New modified.
-
you could always do it without FindWindow , like this... Private Declare Function BringWindowToTop Lib "user32.dll" (ByVal hwnd As IntPtr) As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim proc() As Process = Process.GetProcessesByName("Notepad") Dim x As Integer For x = LBound(proc) To UBound(proc) If proc(x).MainWindowTitle = "Untitled - Notepad" Then BringWindowToTop(proc(x).MainWindowHandle) End If Next End Sub
-
what gets me is , this article on msdn basically states that VBScript is in-compatible with netscape , but JScript is... link to full article >JScript compatibilaty
-
if you want more control over the text , you can read it a line at a time , here's a quick example : Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim od As New OpenFileDialog() od.Filter = "Textfiles|*.txt" If od.ShowDialog = DialogResult.OK Then Dim sreader As New IO.StreamReader(od.OpenFile) While Not sreader.Peek TextBox1.AppendText(sreader.ReadLine & Environment.NewLine) '/// add each line of text one at a time + a newline ( return ) End While sreader.Close() End If End Sub hope it helps :)
-
try this... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Button2.Dispose() Controls.Remove(Button2) '/// you must remove it from the form's control collection. Button2 = Nothing If Not Button2 Is Nothing Then MessageBox.Show("still exsists!") Else MessageBox.Show("it's gone!") End If End Sub
-
you can use " javascript " in internet explorer and " netscape " , but JScript doesnt work on netscape as Voltface said. for example .... // csharp seems the easiest code block to show java in. // check if the browser being used is netscape or ie. // works on both. <script language ="javascript"> if(document.all) { window.alert("you are using internet explorer!"); } else if(document.layers) { window.alert("you are using Netscape!"); } </script> but if you change the "javascript" to "JScript" , it works in ie , but not in netscape.
-
you could use the System.IO.StreamWriter / StreamReader , to save the text and you could save the picture in picturebox1 with something like ... PictureBox1.Image.Save("D:\some pic.jpg")
-
you need to change the Longs to Integers , also in a Boolean Function , use the Return method ( eg: Return True ), here's a quick example : Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Integer, ByVal dwReserved As Integer) As Integer '/// use Integers , not Longs. '/// Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MessageBox.Show(CheckConnectionState) End Sub Private Function CheckConnectionState() As Boolean Dim ConnectionState As Integer = InternetGetConnectedState(vbNullString, vbNullString) If ConnectionState = 1 Then Return True Else Return False End If End Function :)
-
I have built this little project which allows you to Unload all open forms , before closing the main App form down ( to prevent any forms remaining open ) there's a sample code project .zip included , it's quite a simple task, but it may help a few people trying to find ways to close all forms in an App. Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer Private frm2 As New Form2() Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load frm2.Show() Me.BringToFront() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim objType As Type() = Reflection.Assembly.GetExecutingAssembly.GetTypes() Dim x As Integer, i As Integer Try For x = LBound(objType) To UBound(objType) If Not objType(x).Name = Me.Name Then '/// make sure you dont unload this form yet. i = FindWindow(vbNullString, objType(x).Name) PostMessage(i, CInt(&H10), vbNullString, vbNullString) End If Next Catch ex As Exception MessageBox.Show("Oops, the following error occured:" & ex.Message) Finally MyBase.Close() '/// now that all the other forms are closed , unload this one. End Try End Sub hope it helps a few people :) how to unload forms.zip
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sReader As New StreamWriter(New FileStream("C:\somestuff.txt", FileMode.OpenOrCreate, FileAccess.Write)) With sReader .WriteLine("some stuff!") .Close() File.SetAttributes("C:\somestuff.txt", FileAttributes.ReadOnly) End With End Sub
-
do you wish to Drag-Drop , or is the .txt file already in exsistance on the system? because you could always use the StreamReader to put the text in to your textbox if the file exsists somewhere.
-
I would like to start to learn about drawing etc...
dynamic_sysop
replied to Winston's topic in Graphics and Multimedia
a good starter for menu's could be these... divil's : Office XP style Menus and Toolbars VoltFace's : Extend your Menus with IExtenderProvider -
if you hide a form , it'll be sitting in the memory ( which isnt always a good plan ) why not make a declaration of "New Formname" under you windows generated code area? eg: Private MyNewForm As New Form2() '/// above all your other subs^^^ '///////////////////////////////////////////// Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MyNewForm.Show() End Sub then you dont have to keep creating a NEW form , you can just Close() or Open() the form. :)
-
it forces a re-paint of a control / form / whatever Me happens to be.
-
you need to try InternetGetConnectedState , here's a link that may help: checking for internet connection.
-
from the net , here's an example of putting >> :D << in to a picturebox. you can specify your url's as you want in there. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim stream As New Net.WebClient() Dim sr As IO.Stream = stream.OpenRead("http://www.xtremedotnettalk.com/images/smilies/biggrin.gif") PictureBox1.Image = Image.FromStream(sr) sr.Close() End Sub