|
here is one way,
i = RichTextBox1.Text.IndexOf(Chr(10), i)
|
|
|
|
|
This works fine for me:
<br />
Dim i As Integer<br />
Dim MyString As String<br />
MyString = RichTextBox1.Text<br />
i = MyString.IndexOf(vbLf, i + 1)<br />
MsgBox(i.ToString())<br />
|
|
|
|
|
How can I get the number of rows in the data grid programaticaly in VB.Net,where the number of rows dpend on the user entry(the user may add a sum of new rows).
Waleed Eissa
|
|
|
|
|
Windows Forms Faq says to use the BindingManager.Count property
Dim numRows as Integer = dataGridDetails.BindingContext (dataGridDetails.DataSource, _
dataGridDetails.DataMember).Count;
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
Hi,
I am writing an application in VB.NET and want to set an object reference to reference an already open email. Basically I want a user to activate an open email messsage (Outlook being the email client) and then have my application set the object reference (an Outlook MailItem object) to that window which represents that email.
However, I have no idea how to do that. The fact that some of the Window management API functions do not seem to work in VB.NET does not help much. For instance, I tried the simple code below in Excel VBA and it worked fine, but when used in VB.NET it gives an overflow error.
Public Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Public Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Public Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal nMaxCount As Long) As Long
Sub Test()
' Display the title bar text of the foreground window.
Dim hforewnd As Long ' receives handle of foreground window
Dim slength As Long ' length of foreground window's title bar text
Dim wintext As String ' buffer for foreground window's title bar text
Dim retval As Long ' return value
hforewnd = GetForegroundWindow() ' determine the foreground window
slength = GetWindowTextLength(hforewnd) + 1 ' length of its title bar text
wintext = Space(slength) ' make room in the buffer to receive the text
retval = GetWindowText(hforewnd, wintext, slength) ' get title bar text
wintext = Left(wintext, slength - 1) ' remove null character from end of string
End Sub
As I said, the above code works fine in VBA and VB 6 but not in .NET.
Any pointers on how to do this will be greatly appreciated.
Thanks
Vyyk
|
|
|
|
|
I have coded in FORTRAN for many years, where you write code, compile it, link in compiled code from libraries of routines, and run the resulting executable. But we are switching to VB.NET, because we need to write Web Applications. Dynamic link libraries seem like a good choice, but they seem rather complicated. I have also considered Components, and seen references to code libraries and static libraries. We would like to have routines that multiple programmers can use in developing applications. I have muddled through Microsoft Help and MSDN articles, but still don't know what to use. Can anyone help me here.
Glenn W Schreyer
Programmer Analyst II
UTHSC Houston
|
|
|
|
|
If all your looking to do is write a bunch of generic routines that can be used in any app, then your probably looking at the Class Library project. Classes will encompass an entire object, supplying all the methods to manipulate that object. Static (or Shared in VB) classes and methods don't require an instance of the class to work. For an example of this, check out the System.IO namespace. Look for the Directory and DirectoryInfo classes as well as the File and FileInfo classes. The non-Info versions are Static (or Shared in VB), they both versions do just about the exact same thing, they go about them with slight differences.
Design Guidelines for Class Library Developers[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the info. I will read up on Class Libraries. After programming in FORTRAN for so many years, it now seems simple minded compared to VB.NET. At least for me, I have to spend considerable time to learn each new piece of the picture.
Glenn W Schreyer
Programmer Analyst II
UTHSC Houston
|
|
|
|
|
hi all,
I lost all my strength looking for a thing about it in the web and found nothing...
I created a user control that has a collection property.
I want to use the CollectionEditor to show the items in design time.
I you know a good link, sample, thing..
thank!
|
|
|
|
|
check this thread here
http://www.codeproject.com/csharp/DzCollectionEditor.asp?df=100&forumid=25863&select=711981#xx711981xx
|
|
|
|
|
Good Morning.
Can i change the destination directory of the bootstrap files by editing the .LST file created after packaging a program? I mean the files that are being copied first when installing a vb program using the VB setup.exe
Hoping hear from u guys!!!
|
|
|
|
|
this may help:
Manually Editing a Setup.lst File
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconpathparametermacrosinsetuplstfiles.asp
|
|
|
|
|
|
I want to customise a line control such that when I run myy application I can draw lines on the form by clicking and releasing the mouse AND I want that the lines I draw be susceptible to user events such as clicks and get focus. Kinda Like the line control in vb6 authroing environment except that the line control in vb6 doesn't respond to any events.
I'm like stuck on how to make such a line control that can respond to user events like gettiung clicked and getting focus... very much like the line and connectors that are drawn in programs like rational ROse and Visio.
I'm using vb6
This is a complex project and I'm pretty much stuck on a line
|
|
|
|
|
I'm Unable to debug my application inspite of the fact that I've put breakpoints in it.It instead creates a file with extension pdb in the bin folder.Anybody has any clues bout it.
Thnx
g
|
|
|
|
|
I had a similar problem,
Hope u have the debugging rights. Just check project
properties --> configuration properties --> Debugging
---> Enable ASP.Net debugging.
Enable ASP.Net debugging should be true.
(I assume u r having problem debugging ASP.NET applications)
cool man
|
|
|
|
|
Hi
How can i create indexers in Vb.Net
Thanks
|
|
|
|
|
What do you mean? What are you trying to do?
Are you talking about an enumerator as in C#?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I think he was talking about this[^]
As far as I know, VB.Net does not support indexers, though you could always used parameterized properties as a poor man's choice.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
How to create indexes in vb.net
Pls help I will glad to get a reply
Thank You
|
|
|
|
|
Index of what? You'll have to be alot more specific about what your trying to do.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can we use Common Dialog for folder selection? if yes then how.
-qur
|
|
|
|
|
I dont think so you want to look up API SHBrowseForFolder I think or something like that - http://www.mentalis.org/apilist/SHBrowseForFolder.shtml
they have the an example here ( above)
"If i was king cigarettes would be free."
|
|
|
|
|
What do you mean by folder selection? You it return the path of folder location? If yes, I think you we can do. Example: In Ms Word -> tool menu -> Option -> Folder Location tab and select on Clip Art picture then click on Modify... button. Then the modify location dialog appear, this dialog box similar to save/open dialog box. Choose your location that you want then click OK button. Then it will return the default path that Click art dialog will appear when you insert picture.
From here, we can imagine that we select only folder (no file display) then its return the path of the final folder. So I think we can use Common Dialog for folder selection. I never use this method before, but in my option we can do that.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
help me please...do you know how to call the equivalent codes in another worksheet?(the codes were saved in another worksheet).the situation is this, we get the data(relay monitoring data) in TSD machine(test system directory).and after getting it and saved,we transferred the data in excel.in excel, by using the pivot table the datas that has relaycounts were summed up, so the table shows.what im up to is,to get that data's equivalent relaycodes and put it were the pivot table is..pls help me with this..please...tnx a lot!
>sample pivot table:
date (All)
node000 (All)
deck serial# (All)
Sum of relaycount
E322 mux# device Total
E322 0 W1-O'0001' 241473
W1-O'0002' 31038
W1-O'0004' 264470
W1-O'0010' 265920
W1-O'0020' 205564
W1-O'0040' 76032
W1-O'0100' 200748
W1-O'0200' 98630
W1-O'0400' 180551
W1-O'1000' 217583
W1-O'2000' 135117
W1-O'4000' 171008
W2-O'0001' 97822
W2-O'0002' 158529
W2-O'0004' 73015
W2-O'0010' 146991
W2-O'0020' 200390
W2-O'0040' 165522
W2-O'0100' 104003
W2-O'0200' 176688
W2-O'0400' 39158
W2-O'1000' 37260
W2-O'2000' 85264
W2-O'4000' 63123
W3-O'0001' 189568
W3-O'0002' 29730
W3-O'0004' 71374
W3-O'0010' 102936
W3-O'0020' 92540
W3-O'0040' 93394
W3-O'0100' 43051
W3-O'0200' 343854
W3-O'0400' 18418
W3-O'1000' 43638
W3-O'4000' 349714
W4-O'0001' 414846
W4-O'0002' 375504
W4-O'0004' 163400
W4-O'0010' 155733
W4-O'0020' 6811
W4-O'0040' 6811
W4-O'0400' 135515
W4-O'1000' 76145
W4-O'2000' 1012
W4-O'4000' 140622
0 Total 6290515
E322 Total 6290515
(blank) (blank) (blank)
(blank) Total
(blank) Total
Grand Total 6290515
|
|
|
|