Topics
-
- 1 reply
- 2k views
Hi All, I have started to update one of my programs and have decided i should follow the general rule and turn Option Strict On and Option Explicit On and have come across a problem, which I am hope someone will know the answer for. A sample of my code is as follows: Option Strict On Option Explicit On Imports Microsoft Imports Microsoft.Office Imports Microsoft.Office.Interop ' Start Adding Details to a New Excel Workbook Dim objApp As Excel.Application Dim objBook As Excel._Workbook Dim objBooks As Excel.Workbooks Dim objSheets As Excel.Sheets Dim objSheet As Excel._Worksheet Dim range As Excel.Range Dim PR As DialogResult ' Create a new instance of Exce…
Last reply by SonicBoomAu, -
-
- Leaders
- 1 reply
- 807 views
Hi, I just wanna check if my check box on form is checked then enable a button in my safe thread. If SaveCheckBox.Checked = True Then SaveButton.Enabled = True But could not implement this. Delegate Sub SetFocusCallback() Private Sub SetFocus() If Me.SaveCheckBox.InvokeRequired Then Dim d As New SetFocusCallback(AddressOf Enabled) Me.Invoke(d, New Object() {Enabled}) Else If Me.SaveCheckBox.Checked = True Then SaveButton.Enabled = True End If End Sub It won't work! :( Anyone can help me? Thank you a lot and God bless you:)
Last reply by snarfblam, -
-
- 3 replies
- 2.7k views
Hi, I am trying to set the ProgressBar.Value to ProgressBar.Maximum >>> Me.ProgressBar.Value = Me.ProgressBar.Maximum I use this in a thread safe: Private Delegate Sub SetFullPrgressCallback() Private Sub SetFullPrgress() If Me.ProgressBar.InvokeRequired Then Dim d As New SetFullPrgressCallback(AddressOf SetFullPrgress) Me.Invoke(d, New Object() {Me.ProgressBar.Maximum}) Else Me.ProgressBar.Value = Me.ProgressBar.Maximum End If End Sub But I get error, and am not able to troobleshot myself, any help?
Last reply by mskeel, -
-
- Administrators
- Leaders
- 12 replies
- 1.7k views
I just cannot understand why it is not working? It seems everything is alright: Delegate Sub SetFocusCallback(ByVal Focus As Boolean) Private Sub SetFocus(ByVal Focus As Boolean) If Me.OKButton.InvokeRequired Then Dim d As New SetFocusCallback(AddressOf SetFocus) Me.Invoke(d, New Object() {Focus}) Else Me.OKButton.Focus = Focus End If End Sub ... Me.SetFocus(True) ... Also in this line: Me.OKButton.Focus = Focus I get this error: Error 1 Expression is a value and therefore cannot be the target of an assignment.
Last reply by ADO DOT NET, -
-
- 0 replies
- 8.2k views
How do I Programmatically select MULTIPLE rows (DataGridView)? This doesn't seem to work: For i As Integer = 0 To tClase1.Rows.Count - 1 dgClase1(i).Selected = True Next
Last reply by PROKA, -
- 0 replies
- 785 views
Re: My .NET form goes behind others after COM goes away I have a .NET form written in C# (VS2005 SP1) that instantiates a COM object. That COM object brings up a VB6 form. When I close the VB6 form, my .NET form disappears behind any other forms that happen to be open such as Windows Explorer windows for example. I have to click its icon on the taskbar in order for in to come back to the front. EDIT: It appears that its not that the form is going behind, but that the window where the task was launched is brought forward, and given focus. If I run from the debugger, VS2005 gets the focus, and if I run the EXE from a Windows Explorer, then WE gets the focus. I ha…
Last reply by lonewolf32, -
-
- Administrators
- 1 reply
- 886 views
Hello, Private Delegate Sub SetTextCallback(ByVal Message As String) Private Sub SetText(ByVal Message As String) If Me.ReportTextBox.InvokeRequired Then Dim d As New SetTextCallback(AddressOf SetText) Me.Invoke(d, New Object() {Text}) Else Me.ReportTextBox.Text = Me.ReportTextBox.Text + Message End If End Sub This code is working well, but I want to append the new text to the end of text box, since it will replace the new text. Sorry I am a newbie in threading! :rolleyes:
Last reply by PlausiblyDamp, -
-
- 5 replies
- 3.5k views
Hi, I have ASP.Net 1.1 application. It contains a form that has a Dataset that contains one table "Orders". It contains the below fields OrderNumber OrderDate OrderSequence OrderSequence is a sequence number from 1,2,3........... I display the Orders in a datagrid using Orders dataset as source (Sorted by OrderSequence) .The datagrid contains a Textbox displaying the OrderSequence column. I am trying to implement a mechanim=sm that will allow the user to change the sequence of the Order to allow him to move the Order up and down the sequence. When the user changes the OrderSequence , I want to change the OrderSequence in all the Order rows. For e.g.…
Last reply by amir100, -
- 1 reply
- 3.5k views
I've been at this all afternoon and can't figure a way around it. The method has to be static so that is not an option of not being static. Here's the code: private static void ConnectionFilter(String sRemoteAddress, int nRemotePort, Socket sock) { lstMsg.Items.Add("Connection request from " + sRemoteAddress + ":" + nRemotePort.ToString()); } lstMsg is not available but I can't figure out why. I would greatly appreciate any assistance with this.
Last reply by MrPaul, -
- 3 replies
- 1.8k views
Hi All, I hoping this can be done, and i sure someone here can tell me, so here goes. I am using a Windows form and would like a combo box to drop down automatically but only if it has been Tab'd to. At the moment my code is: Private Sub cboWings_GotFocus(ByVal sender as Object, Byval e as System.eventArgs) Handles cboWings.GotFocus ' Automatically drop down the list for selection me.cbowings.droppedDown = True End Sub What i would like to do is throw in a If statement, so the me.cboWings.droppedDown = True on fires when Tab was used to get to that control. Private Sub cboWings_GotFocus(ByVal sender as Object, Byval e as System.EventArgs) Handles cboW…
Last reply by SonicBoomAu, -
-
- Leaders
- 11 replies
- 2k views
I'm basically stress-testing this program I'm writing. I'm running commands extremely quickly and handling exceptions as they come up. The problem is that i've noticed the VS error messages , themselves, really take a chunk out of your processing time.. so i'm wondering if there's a way to make the error message not appear on the Immediate window. I could just build it and run it out of visual studio but I'm looking for a trick I can use often. I dont really want to have to build it and run it out of the studio too often. ---- I guess this brings me to another generalized question. The program i'm making has many routines that run simultaneously on as many threads …
Last reply by IngisKahn, -
-
- 1 reply
- 2.3k views
How can I accomplish this? How can I resize a Texture (either up or down)?
Last reply by EFileTahi-A, -
- 3 replies
- 1.6k views
I'm trying to read an UInt32 value from WMI (Win32_NetworkAdapterConfiguration) but I'm getting some exception... Here's the VB code: Imports System.Management Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mc As New ManagementClass("Win32_NetworkAdapterConfiguration") Dim moc As ManagementObjectCollection = mc.GetInstances For Each mo As ManagementObject In moc If mo("Caption").Equals("[00000010] Marvell Yukon 88E8036 PCI-E Fast Ethernet Controller") Then TextBox1.Text = mo("InterfaceIndex") End If Next End Sub End Class Here's the exception: The exception happens …
Last reply by fawad_asrar, -
- 0 replies
- 851 views
Hello I am getting the following error in Crystal Reports running from a Visual Basic.NET application. The version of Crystal Reports I am using is 9.0. The error is a follows: Error in formula <GroupNameFormula> 'ToText({TMCGetPtProgCrystalReport;1.GroupName})' This crystal report is running off of a stored procedure in sql server 2000. I have looked through my report I have not written the above formula thus I cannot find it any where. Any help offered is greatly appreciated.
Last reply by lothos123452000, -
kill
by ADO DOT NET-
- Administrators
- *Experts*
- 6 replies
- 1.3k views
Kill(My.Application.Info.DirectoryPath & "\*.txt") I am deleting all text files with the above command. but if there is no file I will get an error I want to check first, and if there's at least one file with .txt ext. then run that command. but don't know how to check if there is a file with a specific ext. ? the name maybe anything...
Last reply by SonicBoomAu, -
-
-
- Administrators
- 5 replies
- 1.1k views
Hi everybody, I just use this simple code to run a process on a safe-thread: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim thRead As New Thread(New ParameterizedThreadStart(AddressOf myThread)) thRead.Start() End Sub Private Sub myThread(ByVal o As Object) '...my process... MessageBox.Show("hi") End Sub There is a problem here that this Message Box will not be shown as MODAL. I really need that this message box appear in MODAL state. Usually a message box will be shown as modal, so how should I fix this probelm? Thank you all:)
Last reply by MrPaul, -
-
-
- Administrators
- *Experts*
- 6 replies
- 1.1k views
Does anyone have any tips on how the descriptions should be formed? Is there some sort of guildeline on how to write the documentation?
Last reply by IceAzul, -
-
- 2 replies
- 909 views
Is there a way to define what you want your .DLL file to be in Visual Studio 2005? The only time I've worked with Visual Studio on a website is when I took over a web project @ work. They used VS 2003 and the .DLL file was always named the same as the project. This randomly named .DLL file is really annoying. Thanks in advance! ~Derek
Last reply by Fork501, -
- 2 replies
- 1.5k views
hi, I am developing a pdf report using asp.net but I couldn't find a free good one. I found sharpPdf everyhing was ok till I tried to insert an image in it.itcrashes my image resolution not seems to be good.. I would be glad if you could help me.. thak you
Last reply by mskeel, -
-
- Leaders
- 2 replies
- 1.5k views
I'm new to gdi+ and I'm trying to plot 6x6 pixel ellipses on a map to show positioning. The problem is that I am not able to plot the ellipse precisely to my expected x,y coordinates. It it plotting high and to the left. Any suggestions? here is my code: Dim firstPoint As Boolean = True Dim mapName As String myRead = myCom.ExecuteReader Dim oCanvas As Bitmap Dim g As Graphics Do While myRead.Read If firstPoint = True Then firstPoint = False mapName = myRead.Item("map_name") 'We load an existing bitmap oCanvas = CType(Image.FromFile(Server.MapPath("library/images/maps/" + mapName)), Bitmap) g = Graphics.FromImage(oCanvas) g.ResetTransform() '***********Draw po…
Last reply by snarfblam, -
-
Who's Online 0 Members, 0 Anonymous, 57 Guests (See full list)
- There are no registered users currently online