|
Call the ScrollToCaret method of the RichTextBox control.
RichTextBox1.Focus() ' Make sure the RichTextBox has the focus so ScrollToCaret works.
RichTextBox1.Append("some text to append.")
RichTextBox1.ScrollToCaret()
A warning though, the ScrollToCaret method will NOT work if the RichTextBox control does not have the focus.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave, a big help, as ever.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Hi,
Has anyone developed a custom metadata editor using C#.net or vb.net. if yes, i have a question.
I am trying to develop a custom metadata editor using C#.net. i am using ArcGis 8.3 and Visual studio .net 2003.
when i am trying to execute my custom metadata editor in ArcCatalog it says "Object reference not set to an instance of an object". i don't know where i am going wrong..
I appreciate your help in this regard..
example is given on http://arcobjectsonline.esri.com
Thanks,
abhi
|
|
|
|
|
Just wondering if it is possible to call Library and GetProcAddress from ASP pages or VB scripts.
I know how to do this in VB6 programs from reading some articles on CodeProject. The question is, is the same thing possible in ASP pages or VB scripts? If yes, please let me know.
Thanks.
My articles and software tools
|
|
|
|
|
Nope. You can't call API functions from VBScript or ASP pages.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the answer. Is there a way to get around it? What I want to do is executing code in a non-com dll from ASP pages.
My articles and software tools
|
|
|
|
|
You do realize that is a HUGE security violation?
There is a theoretical way around it. You would have to write an ActiveX control to make the calls into the .DLL for you. This control would have to be an interface between the .DLL and VBScript, basically duplicating the functions you wanted to call in the .DLL and passing the parameters from VBScript to the function in the .DLL and returning the return values.
...in theory anyway. I don't know if your ActiveX control will get the rights it needs to do this though. You'll just have to write up a test control to see...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
You do realize that is a HUGE security violation?
Yes.
Dave Kreskowiak wrote:
There is a theoretical way around it. You would have to write an ActiveX control to make the calls into the .DLL for you. This control would have to be an interface between the .DLL and VBScript, basically duplicating the functions you wanted to call in the .DLL and passing the parameters from VBScript to the function in the .DLL and returning the return values.
Actually, I tried this, it worked on my own machine. However, I cannot get the control registered on the server I am trying to deploy (it's a shared server, I am not allowed to do it).
Another possible way is, I can upload exe file into the site and execute it from my .NET application, but the rights of the ASPNET account is restricted (cannot register a com dll, for example). If only I can execute my exe file from ASP applications, then I will probably be able to get around the problem. BTW, I cannot use WScript.Shell to execute a program from ASP page (it is restricted, CreateObject fails). Anyway, maybe I should not try to avoid paying extra for a dedicated server.
Thanks for your knowledgeable replies.
My articles and software tools
|
|
|
|
|
Hi all,
I have a vb.net app ready and working on a single, standalone machine - XP, SQLSvr2000. Now this has to be ported to a multi-user environment, in which all machines will have XP installed. It is not yet decided whether Win Svr 2003 shall be part of this environment or not.
I wanted to know the following -
1. What are the various changes at code level and at database design level that i need to carry out in order to move to LAN envmt a) with XP, and b) with WIn Svr 2003 ?
2. What are the design issues that i need to consider if it were an altogether fresh project ?
Any guidelines on this shall be highly appreciated.
Thanks in advance and cheers,
Sanjay.
|
|
|
|
|
These are issues tht only your code can answer. If your app was written properly, then you wouldn't have to do anything to it.
If you hardcoded things like the SQL Server name or used an IP address of 127.0.0.1, then you'll have problems. You should store the connection strin gin the app.config file that goes with your application.
If your app is going to run entirely from a network share, then you have to make sure that the code has permissions to run on the XP machines with the trust it needs. This is done with the .NET Framework Configuration tools.
If your app used hard coded SQL statements, don't. Use SQL stored procedures and parameterized queries.
Like I said, it's entirely up to what you've written already...
For more information about "best practices", see the Microsoft Patterns and Practices site at .NET Architecture Center[^] on MSDN.
But if you want to cut right to the chase, there is the Improving .NET Application Performance and Scalability
[^] guide in the Patterns and Practices library (1,120 pages) that will cover nearly all the topics your looking for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave,
Thanks for the tips. I understand its a long haul ahead !
Cheers and regards,
Sanjay.
|
|
|
|
|
how to pass a value from one form to another using
class constructor.
I declard x as integer integer like this:
Region " Windows Form Designer generated code "
Public Sub New(ByVal x As Integer)
MyBase.New()
.
.
how can I return this value to another form.
Thanks.
Go forward and never Stop....
|
|
|
|
|
You want to pass a value to a second form using a constructor. You would have to add a SECOND contructor to your second form's code. Do NOT replace the existing New constructor that doesn't take any parameters. Instead, add a second New constructor, but don't put it inside the Region:
' Form2 code
#Region " Windows Form Desginer generated code "
Public Sub New()
MyBase.New()
End Sub
#End Region
Private x As Integer = 0
Public Sub New(ByVal value As Integer)
m_x = value
End Sub
Now, you said you want to return a value? From the second form? When?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a vb.net program that writes a bitmap image to a file..
IE: C:\map\map.bmp
I want to take that file and print it to a specific printer or multiple printers that is not the default printer in the printer menu. I do not want this to be interactive but automatic. Basically the program is a mapping application and I want a copy of the map to automatically print when the address is located. This is for a fire dispatching environment.
Bob
|
|
|
|
|
You would ahve to load the C:\map\map.bmp file into a Bitmap object. Easy enough:
Dim mapImage As New Bitmap(filepath)
Then you would have to get the list of printers installed on the machine using the PrinterSettings object. There is a static member that returns a string array of all the printer names
Dim printNames As String = PrinterSettings.InstalledPrinters
From there you would loop through the list of list of installed printers and print your Bitmap object to each one:
Dim printer As String
For Each printer In printNames
Dim pd As New PrintDocument
AddHandler pd.PrintPage, AddressOf Me.pd_PrintPage
pd.Print()
Next
Private Sub pd_PrintPage(sender As Object, ev As PrintPageEventArgs)
Dim leftMargin As Single = ev.MarginBounds.Left
Dim topMargin As Single = ev.MarginBounds.Top
ev.Graphics.DrawImageUnscaled(mapImage, leftMargin, topMargin)
ev.HasMorePages = False
End Sub
Warning: This code is untested. I wrote it from memory without the aid of the IDE, so there will WILL be bugs in it!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
Do I have to add the reference object in order to get these properties to work?
Thanks,
Bob
|
|
|
|
|
Be sure your including this at the top of your code
Imports System.Drawing.Printing
No references need to be set.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Bob,
(I am taking a stab at it, I'm not 100% sure, but it douen't hurt to try.)
I don't know how you are trying to print, but you should loop through the procedure with a FOR -> NEXT loop. This will allow you to enter in the amount of time you want to print. In the loop be sure to increase the variable by 1.
|
|
|
|
|
i am developing a ocr application i wanna know how can i segment scanned document into text lines , into words , into characters how ca i do this with vb.net
saud
|
|
|
|
|
This is much to complex a topic to be dicussed in the forums simply because it takes a couple of articles to explain it all. Google for "Open Source OCR" and you'll find a bunch of projects and discussions on the techniques involved.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Im writing app and i have problem with it.
How can retrieves the path and file name when I click right mouse on file in Windows(ex: The files in Windows Explorer, My computer, Desktop...)
Who can help me???
Thanks
tramdtt
|
|
|
|
|
Is your app being launched from the context menu?
If so, then you need to get the path from Environment.GetCommandLineArgs . This will return an array of Strings and should have the path that your looking for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, Dave
Can you speak more clearly for me???
How can register environment variable? I cant find it!!! I use VB6
Do you have any documents about it??? Pls send me: doantram77@yahoo.com
tramdtt
|
|
|
|
|
Sorry, I assumed you were using VB.NET.
In that case, you have to get the command line arguments from Command().
Dim cmdArgs As String
cmdArgs = Command()
You don't have to register any environment variables...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can you explain this code to me:
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("Software\MyApp", True)
regKey.GetValue("Version", 50)
What Changes mus i do to make the value in the registry read from a text box.
|
|
|
|