|
Hi,
Try this to open .doc/.* from vb.net and then u can edit and save it in any format.
Dim info as new ProcessStartInfo("filename.doc")
Info.UseShellExecute= True
Process.START(iNFO)
Hope this works for u.
|
|
|
|
|
Ok, I'm frustrated at this deployment stuff. How can I automatically put shortcuts into the 'all users' dir instead of just into the current user?
I've nuked the installation dialog, so the user can't select. I note this is for a corporate installation, so I can standardize such things, even though they're 'bad form' for "public" installers. This isn't one of those.
I tried setting up a custom folder to the "C:\Documents and Settings\All Users\Start Menu\Programs\" dir, and then add the folders I wanted (company and program folders), and then put the shortcuts in there.
It makes the folders, but then STILL installs the shortcuts over in the current user's startmenu instead of the all users.
Anyone have a clue? The only other thing I can think of is to make my own shortcut files (basically hardcode the shortcuts) and then just tell the deployment project to dump those files over. Will that work?
-Mike
|
|
|
|
|
Try using:
"C:\Documents and Settings\All Users.WINNT\Start Menu\Programs\" as the target folder.
You also have to put the Installation Folder dialog back into the setup, and select "All Users" when the setup is run. This is why it is creating the folder but not putting the shortcuts in it. If you remove the installation folder dialog, the setup defaults to a per-user automatically.
You can also manually edit the MSI to force the All Users install without having to show the dialog. If you have Orca, open the MSI, go to the Propertys table, add a new entry:
Name: ALLUSERS
Value: 1
This will prevent having to show the dialog.
Robert
|
|
|
|
|
Hi,
I have an Access database which looks like this:
Value 1 Value 2
| Text1 | blabla |
| Text1 | blabla2 |
| Text2 | xxxxxx |
| Text2 | yyyyyy |
| Text2 | ffffff |
| Text3 | aaaaaa |
| Text4 | kkkkkk |
There are "Values 1" which repeat one or more time, but each of these repeating values has different "Value 2". What I need is to do this:
Value 1 Value 2
| Text1 | blabla | blabla2 |
| Text2 | xxxxxx | yyyyyy | ffffff |
| Text3 | aaaaaa |
| Text4 | kkkkkk |
I want to add "Value 2" of the rows with the same "Value 1" to the first row of this value and to delete the others... I would like to do this in Access, but I don't understand VBA a lot... Thanks for your ideas
|
|
|
|
|
David Fawn wrote:
I want to add "Value 2" of the rows with the same "Value 1" to the first row of this value and to delete the others
What??? Do you want this result in the database? Do you want all the gethered values from Value 2 to be in the same record appended to each other or in their own seperate columns in the same record?
Value 1 Value 2
Text2 xxxxxxyyyyyyffffff
or
Value 1 Value 2 Value 3 Value 4
Text 2 xxxxxx yyyyyy ffffff
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want them to be in their own seperate columns in the same record? (Example:
Value 1 Value 2 Value 3 Value 4
Text 2 xxxxxx yyyyyy ffffff
|
|
|
|
|
hello, i have a program that when the form loads it looks up in a textfile and if the textfile is empty the program will opens a register form: obj.showdialog(). now i want to when he/she enters a register key in the textbox of the register form and then he can click on the register button. i made it that when he click on the button a messagebox appears saying the user that he registered. now in the messagebox i want to make it with OK and when he click on ok the register form will automatically closes and the program will be active!! how can i make it??
Adrian
|
|
|
|
|
msgbox(" Prompt ", msgboxstyle.Okonly, " caption/title")
If msgboxresult.ok then
form.activeform.close()
End If
I guess this is what your looking for, i dont really understand the question.
|
|
|
|
|
|
I have a custom form that has transparent properties to give it a shape. When i install the app on another computer the transparent part shows up. What can i do about this?
|
|
|
|
|
I want to make my own connection wizard.
I have 3 radio button for user to choice whether they want to connect with MS Acces, SQL Server or Oracle Database.
According to their choice the connection string is passed
such as if user selected to connect with SQL server
a string conn = "datasource=.; user ID =sa; password="
is stored.
Now I want to connect to the server and fetch all the database names so that user can choose any database.
Any sample code will be much helpfull...
Thanks in advance..
|
|
|
|
|
|
Thanks so much...
Its did a trick..
You are the Rock. ;)
|
|
|
|
|
I have been using below code for freehang drawing in vb.net.But it doesn't change the color of new drawn line only.it changes the whole mousepath color, means if i select blue and previous one is red then whole path becomes blue.
But i desperately need screen pen effect like if i select blue then only blue reflect on mousepath and previous path(previously drawn line) color remains same.As like paint previous lines color remain same.
If any one knows plz help me!!!!
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Public Class Form1
'Namespace myPaint
Inherits System.Windows.Forms.Form ' Of course
Dim mousePath As New System.Drawing.Drawing2D.GraphicsPath() 'declare a new Graphic path to follow the mouse movement
'*** below I declare some values for an Alpha and other user selected variables
'these will be used as I expand this program for a higher level use.
Dim myAlpha As Integer = 100 ' declare a Alpha variable
Dim myUserColor As New Color() 'this is a color the user selects
Dim myPenWidth As Single = 5 'set pen width variable
'**************************************************************
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.Panel1 = New System.Windows.Forms.Panel
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Panel1.SuspendLayout()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(87, 35)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(393, 27)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Below is a Graphics path freehand drawing space"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(488, 112)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 3
Me.Button1.Text = "RED"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(488, 160)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 4
Me.Button2.Text = "BLUE"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(488, 216)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 5
Me.Button3.Text = "GREEN"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(488, 264)
Me.Button4.Name = "Button4"
Me.Button4.TabIndex = 6
Me.Button4.Text = "YELLOW"
'
'Panel1
'
Me.Panel1.BackColor = System.Drawing.Color.Gray
Me.Panel1.Controls.Add(Me.PictureBox1)
Me.Panel1.Location = New System.Drawing.Point(24, 80)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(448, 280)
Me.Panel1.TabIndex = 7
'
'PictureBox1
'
Me.PictureBox1.BackColor = System.Drawing.Color.Transparent
Me.PictureBox1.Location = New System.Drawing.Point(16, 24)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(408, 240)
Me.PictureBox1.TabIndex = 8
Me.PictureBox1.TabStop = False
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.BlanchedAlmond
Me.ClientSize = New System.Drawing.Size(579, 534)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Johns' Free Hand Doodle"
Me.Panel1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
myUserColor = (System.Drawing.Color.Red)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
myUserColor = (System.Drawing.Color.Blue)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
myUserColor = (System.Drawing.Color.Green)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
myUserColor = (System.Drawing.Color.Yellow)
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = MouseButtons.Left Then ' draw a filled circle if left mouse is down
mousePath.StartFigure() ' The L mouse is down so we need to start a new line in mousePath
End If
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If e.Button = MouseButtons.Left Then ' draw a filled circle if left mouse is down
Try
mousePath.AddLine(e.X, e.Y, e.X, e.Y) 'Add mouse coordiantes to mousePath
Catch
MsgBox("No way, Hose!")
End Try
End If
PictureBox1.Invalidate() 'Repaint the PictureBox using the PictureBox1 Paint event
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
' Here is where we do the actual painting
Try ' error trapping
'myUserColor = (System.Drawing.Color.Black) 'You can remove this line and add a user selected color to
'change the value of myUserColor
myAlpha = 100 ' This will give the color a Alpha effect, you can set this to 255 if you want a full color
'*********************** NOTE ***********************************************
'The line below set the pen up with the ability to add user selected Alpha, Color and Penwidth
' A simpler, but less flexible solution would be to replace the line with the following code:
'Dim CurrentPen = New Pen(System.Drawing.Color.Black, myPenWidth)
'************ End Note ***************************
Dim CurrentPen = New Pen(Color.FromArgb(myAlpha, myUserColor), myPenWidth) 'Set up the pen
e.Graphics.DrawPath(CurrentPen, mousePath) 'draw the path!
Catch
' MsgBox("Not happening!")
End Try
End Sub
'End Namespace
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
End Sub
End Class
'Form1
Megha
|
|
|
|
|
The problem you are having is that a GraphicsPath hold all the points that is being drawn on the PictureBox1 object. When you go and paint the PictureBox1 with GraphicsPath you are painting with only one color, the current color at that time. What you need to do is create a GraphicsPath one for each color and when you want to draw in that color use the GraphicsPath you assign to that color. This way each GraphicsPath object holds multiple objects of the same color. Also you must check mousePath has a valid value otherwise you will get an execption as when you first start and do not select a color. Here is how I modified you code to do what you want.
Imports System
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
Public Class Form1
Inherits System.Windows.Forms.Form
' Just to help in documentation
Enum PathColor
RED = 0
BLUE = 1
GREEN = 2
YELLOW = 3
End Enum
' Dim mousePath As New System.Drawing.Drawing2D.GraphicsPath 'declare a new Graphic path to follow the mouse movement
Dim path(3) As GraphicsPath ' Holds 4 GraphicsPath objects one for each color
Dim mousePath As GraphicsPath
'*** below I declare some values for an Alpha and other user selected variables
'these will be used as I expand this program for a higher level use.
Dim myAlpha As Integer = 100 ' declare a Alpha variable
Dim myUserColor(3) As Color ' The 4 colors that the user can selects from
Dim myPenWidth As Single = 5 ' set pen width variable
'**************************************************************
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.Panel1 = New System.Windows.Forms.Panel
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Panel1.SuspendLayout()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(87, 35)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(393, 27)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Below is a Graphics path freehand drawing space"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(488, 112)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 3
Me.Button1.Text = "RED"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(488, 160)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 4
Me.Button2.Text = "BLUE"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(488, 216)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 5
Me.Button3.Text = "GREEN"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(488, 264)
Me.Button4.Name = "Button4"
Me.Button4.TabIndex = 6
Me.Button4.Text = "YELLOW"
'
'Panel1
'
Me.Panel1.BackColor = System.Drawing.Color.Gray
Me.Panel1.Controls.Add(Me.PictureBox1)
Me.Panel1.Location = New System.Drawing.Point(24, 80)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(448, 280)
Me.Panel1.TabIndex = 7
'
'PictureBox1
'
Me.PictureBox1.BackColor = System.Drawing.Color.Transparent
Me.PictureBox1.Location = New System.Drawing.Point(16, 24)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(408, 240)
Me.PictureBox1.TabIndex = 8
Me.PictureBox1.TabStop = False
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.BlanchedAlmond
Me.ClientSize = New System.Drawing.Size(579, 534)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Johns' Free Hand Doodle"
Me.Panel1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
mousePath = path(PathColor.RED) ' Assigns the correct GraphicsPath for this color
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
mousePath = path(PathColor.BLUE) ' Assigns the correct GraphicsPath for this color
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
mousePath = path(PathColor.GREEN) ' Assigns the correct GraphicsPath for this color
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
mousePath = path(PathColor.YELLOW) ' Assigns the correct GraphicsPath for this color
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = MouseButtons.Left Then ' draw a filled circle if left mouse is down
mousePath.StartFigure() ' The L mouse is down so we need to start a new line in mousePath
End If
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If e.Button = MouseButtons.Left Then ' draw a filled circle if left mouse is down
Try
mousePath.AddLine(e.X, e.Y, e.X, e.Y) 'Add mouse coordiantes to mousePath
Catch
MsgBox("No way, Hose!")
End Try
End If
PictureBox1.Invalidate() 'Repaint the PictureBox using the PictureBox1 Paint event
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
' Here is where we do the actual painting
Try ' error trapping
'myUserColor = (System.Drawing.Color.Black) 'You can remove this line and add a user selected color to
'change the value of myUserColor
myAlpha = 100 ' This will give the color a Alpha effect, you can set this to 255 if you want a full color
'*********************** NOTE ***********************************************
'The line below set the pen up with the ability to add user selected Alpha, Color and Penwidth
' A simpler, but less flexible solution would be to replace the line with the following code:
'Dim CurrentPen = New Pen(System.Drawing.Color.Black, myPenWidth)
'************ End Note ***************************
' Paint all the GraphicsPath one color at a time
For index As Integer = 0 To 3
Dim CurrentPen = New Pen(Color.FromArgb(myAlpha, myUserColor(index)), myPenWidth) 'Set up the pen
e.Graphics.DrawPath(CurrentPen, path(index)) 'draw the path!
Next index
Catch
' MsgBox("Not happening!")
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Create GraphicsPath for each color
For i As Integer = 0 To 3
path(i) = New GraphicsPath
Next i
' Create each color
myUserColor(PathColor.RED) = myUserColor(PathColor.RED).Red
myUserColor(PathColor.BLUE) = myUserColor(PathColor.BLUE).Blue
myUserColor(PathColor.GREEN) = myUserColor(PathColor.GREEN).Green
myUserColor(PathColor.YELLOW) = myUserColor(PathColor.YELLOW).Yellow
End Sub
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
End Sub
End Class
'Form1
----------------------------------
I hope that this was of some help.
-Fernando Soto
|
|
|
|
|
Hi,
Can any one tell me that is Nullable types are supproted in vb.Net 2005? If so, is it like c#.net?
|
|
|
|
|
Do u mean DBNULL.Value or dim x as object= Nothing;
Both r able to been used.
|
|
|
|
|
I URGENTLY need to be able to pass a network file path through to a function and obtain the PIDL. Can someone please let me know how I can do this.
|
|
|
|
|
Hi,
I'm writing an application in VB.net that takes a string & a number from the user & prints a receipt using the System.Drawing.Printing class. Is there anyway to detect the "out-of-paper" case , as i need to take corrective actions in such case. I checked out all the properties & settings of PrintDocument & PageSettings classes but found nothing.
any hints are really appreciated.
thanx
|
|
|
|
|
http://support.microsoft.com/default.aspx?scid=kb;en-us;821769
|
|
|
|
|
Thanx alot.. i think the article will help
|
|
|
|
|
i have build a custom datagrid using the datagrid. How can i add AutoFormat in my control just like datagrid has. another problem is that i am fetching data in the load event of the control, so when i fetch the data it works well the first time but when i reopn the same project it shows all the data at the design time. how can i avoid this.
|
|
|
|
|
Hi all, i use Vs 2005 beta, there is no DataGrid Object so i use DataGridView Object. But DataGridView object doesnt support DataGridTableStyles. When i used VS. 2003 , i created a class named "DataGridExtendedColumn" supplying numeric, commaseperated numbers also functional keys. But i couldnt use that with DataGridView object.
i create a table named "ExportDetails" at run time then i set it to DataGridView's DataSource. At design Time, i created columns on DataGridView then i set each column's DataPropertyName to associate column at table "ExportDetails" .
What can do for supplying to users a field which they can numeric numbers or comma separated numbers.
NOT:SURE I am aware of DataGridView object has no property as DataGridTableStyle despite of VS 2005 has DataGridTableStyles object.
|
|
|
|
|
Hi,
Ive not yet had the time to try out the new DataGridView but the DataGrid is still provided in the new framework version. It just isnt placed in the toolbox of VS.Net 2005 by default. Just right click into your toolbox. There is a menu entry where you can add/remove items. It will show you a big list where you just have to find the DataGrid .
|
|
|
|
|
Hi,
I am using the shell command in vb.net to run a dos program. After the program is finished it outputs to the screen some results. Is there anyway to read this back into a Rich text box.
Thanks
|
|
|
|
|