|
hi
for example i want a list of windows form name in a combo box ?
thnx
|
|
|
|
|
It's been answered in the C# forum.
|
|
|
|
|
I am wondering if there is a code to save a file with a specific file name. That file name will change with each save.
For example: I have made some word templates, this are Injury Reports for my employer. So each time it gets used, it will be saved with a different name. But I would like each one of them to have the same basic file name.
i.e. 041908-01
041908-02
041908-03
042008-01
So this is the date, and the report number.
Any suggestions?
|
|
|
|
|
There must be many ways:
1. write a small program that copies a template, renames it the way you want, then opens it
for editing.
2. write some VBA code that sits inside your template and does what you need; I trust this
is possible, but I never actually did such things.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hello,
i want to send messages between two PCs and I have a problem with that, if i get a message from the server, i can display it in a MessageBox, but if i want to write that in a String or StringBuilder, only the first time it puts the message in the string. The other times i get a new message from the server, it shows me the message in the message box, but it doesnt put it in my string oO?
Here's the code:
//Code deleted
But there's something crazy, it shows me every time two messageBoxes if i get a message from the server, one, where the really message from the server is in, and one empty, but it isn't really empty, i checked that and i found out that the ascii code of this empty message is "0"... so is that maybe the problem? and where it could come from... i have no idea... oO
Thanks for your help
modified on Monday, April 21, 2008 1:52 AM
|
|
|
|
|
Hi, I can't see anything obviously wrong in your code, however without the server code it's a bit difficult to test. Could you post that too.
Regards, Rob
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
The Server Class:
// Code deleted
and for multi-user the user-class
// Code deleted
modified on Monday, April 21, 2008 1:51 AM
|
|
|
|
|
Hi softwarejaeger, it looks like the problem is in the User.Process method. Notice that the client.ReceiveBufferSize seems far to large for your message... the size is in fact an 8KB block, so you need to use the return value from Client.GetStream.Read before calling Send (just as you've done in Client.DoListen). Heres the modified code:
Dim Buffer(client.ReceiveBufferSize-1) As Byte
Dim i As Integer = Client.GetStream.Read(Buffer, 0, CInt(Client.ReceiveBufferSize))
MsgPack = System.Text.Encoding.ASCII.GetString(Buffer).ToString()
Send(System.Text.Encoding.ASCII.GetString(Buffer, 0, i))
A couple of other things: vb.net arrays are zero based and are defined by specifying the upper limit, not the array length - thats why i've added the -1 to the array dim.
Also, for all programmers sakes, please avoid using GoTo A While loop is a much more elegant way of looping through this method.
Good luck!
Rob
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
Many thanks now it works
|
|
|
|
|
In visual basic 2008 express edition
I need the code for a button that when clicked sends the text in that button to the selected window
Thanks in advance
Jamie
|
|
|
|
|
Noone is going to just hand you the code.
You don't have the Windows Internal's knowledge to pull this off. It's not as simple as clicking a button and calling SendKeys. Do you think you have the skill to have a button on your form clicked successfully without your window having the input focus?? Do you know what the "input focus" is??
|
|
|
|
|
Hello,
I am trying to do the following:
Private Sub GetDepartmentTest()
Dim myDataset As New DataSet("Databasename")
'load data from xml file
myDataset.ReadXml("C:\XmlDatabase\Data.xml")
Dim myDataRow As DataRow = myDataset.Tables("Department").Rows(0)
' the next line gives an error
Dim myDepartment As Department= myDataRow
MsgBox(myDepartment .Name)
End Sub
Class Department
Inherits Data.DataRow
Public Sub New(ByVal builder As DataRowBuilder)
MyBase.New(builder)
End Sub
Property Name() As String
Get
Return Item("name")
End Get
Set(ByVal value As String)
Item("name") = value
End Set
End Property
End Class
But I keep getting an error:
<br />
System.InvalidCastException was unhandled<br />
Message="Unable to cast object of type 'System.Data.DataRow' to type 'Department'." <br />
The error occurs on this line:
Dim myDepartment As Department= myDataRow
Can someone tell me what I do wrong?
|
|
|
|
|
You are mixing you data types.
You need a property for each field in the table
You need a private var for each field
then you can populate the object
Private Overloads Sub RowToObject(ByVal oTable As DataTable)<br />
If (IsNothing(oTable) OrElse oTable.Rows.Count = 0) Then 'no table not row then empty the object<br />
mvPFClassID = Nothing<br />
mvPFClass = Nothing<br />
mvModified = Nothing<br />
mvModifiedBy = Nothing<br />
Else<br />
Dim oRow As DataRow = oTable.Rows(0)'get the first row from the table<br />
mvPFClassID = IIf(IsDBNull(oRow("PFClassID")), 0, oRow("PFClassID"))'load the properties via the private vars<br />
mvPFClass = oRow("PFClass") & ""<br />
mvModified = IIf(IsDBNull(oRow("Modified")), Nothing, oRow("Modified"))<br />
mvModifiedBy = oRow("ModifiedBy") & ""<br />
End If
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
HI fnds,
I want to transfer and recieve an Image through serial port..
plz help me the code in VB.net
Thanks and Regards,
Ramesh Morasa
|
|
|
|
|
Open Image file in Binary mode and send it through serial port.
and receive also in Binary mode.
put your serial port encoding to UTF-8
use this for put UTF-8 Encoding
SerialPort1.Encoding = System.Text.Encoding.GetEncoding(1252)
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Please read the forum guidelines; your posts should have more meaningful titles.
|
|
|
|
|
I am almost a complete beguinner in visual basic
I want to create a program that can insert accented letters into any microsoft program (word, notepad)so that when you press a button with an accented e that will come up on your work (i worte on screen keyboard on the top because i didnt know what this would be called) i want my program to be on top of all other programs. I need alot of help with the code though!! Thanks in advance
Jamie
please email me with any solutions at jamiepascoe@hotmail.com
|
|
|
|
|
There is an on screen keyboard CP article. Getting it to work between apps, is probably a little complex for you right now.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I do love an understatement!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Oy thats not fair, i bet sometime you were a beguinner aswell
Anyway i have looked at all the links and i cant find anyhting that is what i want, i just want the code so that when you press a button the text in that button is sent to the selected window(application) somebody please help me
thanks in advance
Jamie
|
|
|
|
|
In order to press a button in one application, it needs to have the input focus. Since your keyboard now has the focus, what was the last control to have the focus??? Hint: There's no function or method that will tell you that. So where do you send the key stroke??
|
|
|
|
|
Please help me i've seen it done before i just dont know how to code it in i think possibly you could set it so when a button is pressed it opens a microsoft word document and then all the other buttons simply Word.Application = Word.Application & button1.Text but word. Application does not seem to work in vb 2008 express edition.
Can no one help me
Please
|
|
|
|
|
This should be a softball for some of you.
I want to have all of the text in a textbox highlighted when I enter (click, tab, etc) into it. How do you do that?
Thanks in advance!
|
|
|
|
|
Use the selectionstart and selectionlength properties, set them to 0 and the length property of the text.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
TextBox.SelectAll()
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|