|
What are you trying to do here? That is the weirdest piece of code i think i've ever seen.
What does
mex_young wrote:
fSaveGuiToFile
do?
I am happy to help as i think it quite a simple solution, but can you explain the problem a little better.
If you could please explain what you need to do?
Thanks
"If i was king cigarettes would be free."
|
|
|
|
|
I actually want the code of mine which was pasted there to work with the program where u may download in zip format.
The code of MINE which is pasted is actually a part of my script which saves a .bmp file to C:\ automatically when it is pressed! and changes the file name to something like - 001.bmp, 001.bmp... etc! and goes on as the button is pressed. i hope you understand...thanx
|
|
|
|
|
I have created a Event in a form and raised it in another class within the same project.
The "RaiseEvent" was executed in the class, but the event was not trigger in the form.
Anybody have any ideas???
|
|
|
|
|
I'd check first to see if the EVENT on the form has a handler. Sometimes if you delete or cut/paste a control you'll loose the handler for the event but the event stays and you're left scratching your head.
Sub MyEvent(byval sender as object, byval e as system.event) handles MyClass.MyEvent
-or-
addHandler MyClass.MyEvent, addressOf MyEvent '<--Handler won't get deleted if you cut/paste
Other thing that happens to me is some other event raises an exception and causes the RaiseEvent to fail. Especially if i have a Try Catch with an empty catch that i havent coded in a response yet(not a good practice)
|
|
|
|
|
How can I create FTP client that can automatically download files from server at specified interval and place it on a specified location on local system.
|
|
|
|
|
Hello guys
any one can help me to write a script which will rename Neoware thin clients
hostnames?
I'll appreciate it!!!
Thanks in advance
|
|
|
|
|
This can't be done in any of the scripting languages, like VBScript. It must be done using a full application laungage and this app MUST be run by an Administrator of the machine in order for it to work.
The API Function that you're looking for to do this is SetComputerName[^]. Once the change is made, the machine MUST be rebooted for the change to take effect.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave
The OS is WinCE.
Can you give me a simple steps on how to write a simple application to rename hostnames?
and what language? Can I use C#?
Appreciate your time!!!
|
|
|
|
|
The language you use is up to you. There's nothing special about an app like this. All you need to do is get a string, however you choose, that represents the hostname you want to change the machine anme to, then make a call to SetComputerName. That's it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everybody. I am trying to create a string which will have spaces in between words that create "columns". In vb6 i used to use tab(<and the="" number="" of="" column="">). EG string 3 = string1 & tab(5) & string2 and i would have the following:
areaName PostCode Suburb
test 125 the suburb
test2 225 another suburb
so when i use the print command to have it in columns.
How to i do that in vb.net. Thank you in advance.
Still trying to find the way
|
|
|
|
|
I just had that same problem. Here is an example:
<br />
' Draw all font names on form<br />
Dim gr As Graphics = Me.CreateGraphics<br />
gr.Clear(Color.White)<br />
<br />
' Prepare a message with tabs and carriage returns.<br />
Dim msg As String = String.Format("{0}Column 1{0}Column 2{0}Column 3{1}" _<br />
& "Row 1{0}Cell (1,1){0}Cell (1,2){0}Cell (1,3){1}" _<br />
& "Row 2{0}Cell (2,1){0}Cell (2,2){0}Cell (2,3){1}", _<br />
ControlChars.Tab, ControlChars.CrLf)<br />
Dim fnt As New Font("Arial", 12)<br />
<br />
Dim strFormat As New StringFormat()<br />
' Set the tab stops.<br />
Dim tabStops() As Single = {80, 140, 200}<br />
strFormat.SetTabStops(0, tabStops)<br />
' Draw the text with specified tab stops.<br />
gr.DrawString(msg, fnt, Brushes.Black, 20, 20, strFormat)<br />
<br />
fnt.Dispose()<br />
gr.Dispose()<br />
<br />
Hope that hels you!
|
|
|
|
|
Hi,
Does anybody know where I can find some information on Database
access/update/delete through VB.NET
I'm creating a program with multiple forms, which needs to select,add,delete
record from an ACCESS DB.
It is my first DB project and I'm totally lost...
Any help I would greatly appreciate it...
Thank you,
CJ
|
|
|
|
|
Hello CJ. Ok i am new too in vb.net and i had such a problem to find a solution with Access and VB.NET. BUT i found the answer that you are looking for too. Here it is:
************************* Searching in a database:
Dim strConnection As String = OleDbConnection1.ConnectionString
(the connectionString will be a string created from the VB when you specify where your database is)
Dim connect As New OleDbConnection(strConnection)
Dim test As String
Dim te As String
Dim SQLString As String
connect.Open()
te = txtAreaToSearch.Text
SQLString = "SELECT * from informations WHERE Area =" & "'" & te & "'"
Dim cmd As New OleDbCommand(SQLString, connect)
Dim reader As OleDbDataReader = cmd.ExecuteReader()
While reader.Read()
txtCouncilName.Text = reader.GetValue(1) 'gets the value of the first attribute in your databse eg postCodeOfTheArea
End While
reader.Close()
connect.Close()
In this example you will need a OleDbConnection1 and a OdbcCommand1 objects. Also the following must be put at the start :
Imports System
Imports System.Data
Imports System.Data.OleDb
What the example does is to search in a database on the TABLE informations for an AREA with the name that is in a TEXTBOX called txtAreaToSearch.
********************************** Deleting an entry
Dim SQLStringUpdateKeys As String
Dim SQLStringUpdateArea As String
Dim icount As Integer
Dim icount1 As Integer
Dim strConnection As String = OleDbConnection1.ConnectionString
Dim connect As New OleDbConnection(strConnection)
Dim inputOption As Integer
inputOption = MsgBox("Are you sure you want to delete this record", MsgBoxStyle.OKCancel, "Are you sure?")
If inputOption = 1 Then
connect.Open()
On Error Resume Next
SQLStringUpdateArea = "DELETE FROM informations WHERE Area = '" & txtAreaName.Text & "'"
Dim cmd1 As New OleDbCommand(SQLStringUpdateArea, connect)
icount1 = cmd1.ExecuteNonQuery
connect.Close()
MessageBox.Show("Records Deleted in table: " & icount1)
Else
Exit Sub
End If
************************* inserting a new entry
Dim SQLStringUpdateKeys As String
Dim SQLStringUpdateArea As String
Dim icount As Integer
Dim icount1 As Integer
Dim strConnection As String = OleDbConnection1.ConnectionString
Dim connect As New OleDbConnection(strConnection)
connect.Open()
On Error Resume Next
SQLStringUpdateKeys = "insert into informations values('" & txtKeyWordUp.Text & "','" & txtAreaNameUp.Text & "')"
Dim cmd As New OleDbCommand(SQLStringUpdateKeys, connect)
cmd.ExecuteNonQuery()
icount = cmd.ExecuteNonQuery
connect.Close()
connect.Dispose()
MessageBox.Show("New records added in table: " & icount)
Hope this helps.
Still trying to find the way
|
|
|
|
|
Wow, I was way off..
Let me give this a try... thank you "Chaos Machine"
|
|
|
|
|
Drop an OleDbDataAdapter on a form and use the wizard to connect to the access DB and select a table that you want to view and it will auto-generate all the select, insert, delete and updates for the table. Right click the OleDbDataAdapter and choose Generate DataSet. Add a DataGrid to your form and set the DataSource and DataMember for the DataGrid in the properties Grid. ON the form load event add:
Me.OleDbDataAdapter1.Fill(DataSet1) '<-- Assuming you used the default autogenerated names.
I suggest reading thru MSDN and just search using DataSet, DataView, BindingManager, BindingManagerBase, CurrencyManager, Calculated Column, Strongly Typed DataSet. You'll need to know what all these things are if you are ever to make anything work. MSDN & Google is your best source really for learning just lookup those words.
Don't buy the Book "Programing MicroSoft VisualBasic.Net For MicroSoft Access Databases", it's absolute garbage.
Use the "DataForm Wizard" by selecting File|Add new item and look at how it builds a form with navigation buttons.
I've been learning all this over the last few weeks, and I must say it's quite FUSTRATING to say the least. It shouldnt be this hard to connect to data and work with it without using third party solutions.
I've been playing with the 2005 vb.net Beta and It looks like it's going to be much much easier to work with.
|
|
|
|
|
Thank you...
VB is supposed to be this easy to learn, "foolproof" language...Its not!
|
|
|
|
|
nyjcr wrote:
VB is supposed to be this easy to learn, "foolproof" language...Its not!
It's not that the language is hard to learn, IMHO it's not and neither was C++, C#, Java, COBOL, Intel x86 Assembler, TI 9900 Assembler, FORTRAN, ... It's learning how to string together a bunch of statements that makes sense and does what you want that's the hard part. This is true for ANY language.
|
|
|
|
|
nyjcr wrote:
VB is supposed to be this easy to learn, "foolproof" language...Its not!
.Net has made so many thing with VB much easier than previous versions, with the exception of connecting to a plain ol Access database. I miss using vb6 only for data, but im really starting to get the hang of ADO.Net and am starting to like it.
|
|
|
|
|
I have searched now for 3 hours, it is time 2 ask some people if it is posible. My question: I have a project for school and I made an awsom cartoon illustration for the application, but the app needs some textboxes ass wel. But I don't want to let the illustration get behind the textbox so you can't see it anymore.
Is ther a way to set the alpha of an textbox to 50% or sow? So that both are visible? That would be very nice. I have tryed some things bud nothing seems to work. Opacity works only with the form, Transparency Key doesn't work for me because if I set it 2 white, you can't see the box anymore but you can see right trough my programm, sow that is not what I want.
Are ther some people who know if this is posible and how to do this?
Sory for my English.
|
|
|
|
|
Can I use multiple resource files in VB? It seems that the IDE will only let me work with one...
Thanks,
Tim
|
|
|
|
|
I am using the XMLDocument class to extract a specific node's data and then replace it with different data. This is done successfully but when I save the file the second line is modified to contain "[]" after the dtd declaration.
The first two lines of the XML file looks like this before I run my code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE POWERMART SYSTEM "powrmart.dtd">
After running my code the first two lines look like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE POWERMART SYSTEM "powrmart.dtd[]">
The following is a bare-bones section of my code:
Dim xd As New Xml.XmlDocument
xd.XmlResolver = Nothing
'Load the xml file
xd.Load(filepath)
'Find the Element Node (INSTANCE)
Dim NodeList As Xml.XmlNodeList
Dim Node As Xml.XmlNode
NodeList = xd.DocumentElement.GetElementsByTagName("INSTANCE")
For Each Node In NodeList
If Not Node Is Nothing Then
'Find the Attribute of this element ("TRANSFORMATION_NAME")
TransformationName = Node.Attributes.GetNamedItem("TRANSFORMATION_NAME").Value
'Set the new Attribute of the element("TRANSFORMATION_NAME")
NewTransformationName = "NEW_NAME"
' Write the new TransformationName
Node.Attributes.GetNamedItem("TRANSFORMATION_NAME").Value = NewTransformationName
' Reset node to nothing
Node = Nothing
End if
Next Node
xd.Save(filepath)
For some reason when this saves to XML it modifies the DOCTYPE line to add a [] at the end of the .dtd expression, and I don't know why. If anyone could help I would greatly appreciate it.
|
|
|
|
|
I am interested in someone providing a sample that has a panel on a user control that contains a collection of controls available at design time. To put it simply I would like the following.
1. a user control
2. a panel control
3. a collection of, let's say, label controls that are accessible at design time that are contained on the panel
I understand the method to add a collection, or any control, to the properties window is <designerserializationvisibility(designerserializat ionvisibility.content)="">. What I don't understand is 1. How to create the collection of controls and where to place the <designerserializationvisibility(designerserializat ionvisibility.content)="">. 2. How to place the controls on the Panel at design time.
BTW, I haven't found this simple example on any of the forums. I think Microsoft should provide a decent example of this.
A little extra information to clarify the need. I need a user control containing a panel with a collection of controls where the user control has the collection exposed in it's property window when it is dropped on a form. This will be much like the grid control, which has a columns property in it's property window. When the user clicks on the ellipse '...' an editor pops up where you can add and remove columns and set their properties.
|
|
|
|
|
Anonymous wrote:
I was trying to use two DataReaders. I guess I need to use two DataSets?
The number of DataSets is not the problem. You can only have one active DataReader object on a connection and any one time. You can have multiple DataSets filled by a DataReader, though.
Anonymous wrote:
"mySqlConnection.Open()"
at the top of my Sub() and close at the bottom. Is this ok?
Not really. You should .Open() your connection immediately before your fill the DataSet , or do whatever you need to do with the database, then .Close() the connection as soon as your done with it. DON'T leave it open and idle for ANY reason. This needlessly consumes resources on the SQL server, not to mention hogs a very expensive licensed connection on the server too.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for all your help!
|
|
|
|
|
It sounds funny, but is there any way to hide
checkbox from checkbox control?
|
|
|
|