|
|
Dont know why it is'nt working , but instead of having an extra component with your application you can just add some values to the registry and add menus
I know, its not written in Visual Basic, but its close to VB as its written in VB script, but you can easily figure out how it works heres the link: http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/computermanagement/desktop/
And heres the actualy code if you don't want to go to that website :
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite "HKCR\Folder\Shell\MenuText\Command\", _
"cmd.exe /k cd " & chr(34) & "%1" & chr(34)
objShell.RegWrite "HKCR\Folder\Shell\MenuText\", "Command Prompt Here"
PS. Sorry about poor grammar/spelling too tired to think at the moment
|
|
|
|
|
Thanks, but this is handy for 1 or 2 items for the same program. however I use for my program 12 items + a separator in 1 submenu. If I add all this items directly in the submenu it is not properly shown for the user and it look very pushy. So I used this system to have a submenu like winzip, winrar, groove, copy to, ...
Jan
|
|
|
|
|
I am trying to show a modeless userform in VBA Word to make available several editing functions (a floating toolbar in effect). But adding lines of code at run-time makes it impossible to keep the shown form after the caller completes execution.
I am working in Word 2007, using the built-in VBA editor. These modules are part of a custom built template.
I am adding the buttons at run time to simplify customisation and loading, since I have separate sets of functions I apply this method to. I do this by iterating the particular code module grouping the procedures I want to make accessible while word processing. This takes place in a module spearate from the form. I can find the code added correctly in the userform afterwards. For example
.AddFromString "Sub CommandButton1_Click()" + vbCr + _
"Unload Me" + vbCr + _
"End Sub"
.AddFromString "Sub " + Proc + "_Click()" + vbCr + _
Title + "." + Proc + vbCr + _
"End Sub"
Produces
Sub CommandButton1_Click()
Unload Me
End Sub
Sub pasteSynonyms_Click()
TextCommandsModule.pasteSynonyms
End Sub
etc
The form is created, and appears intact when the show procedure is called. However, when the calling sub exits (invoked either by a shortcut or with a macrobutton in the text) the form disappears again. Removing the lines that add functionality to the buttons, by adding instructions to the codemodule, overcomes this. But I am left with pretty buttons that dont do anything.
I have tried creating the form at run time. I have tried adding a new instance, declared as global variable, of a form template that I build on, and I have tried using the userform module itself, as default instance. In all cases the form is released and, in the case of a new instance, is also unloaded again. I use other modeless forms in the same application without this problem: I can invoke them and they stay around after the calling sub exits again. The difference is that I call the sub to dynamically modify controls, and that I insert lines of code.
How can I add code and avoid the userform disappearing when the code returns?
modified on Sunday, April 5, 2009 10:11 PM
|
|
|
|
|
I am usin microsoft access as backend database and using dataenvironment in my vb application to connect the database.
The problem I am facing with dataenvironment is when I open any recordset from the dataenvironment it get all the records and hold it in the recordset and if I make changes in any field of the record it does not appear to the other users of the network.
What technique should I use to solve this problem?
THanks in advance.
|
|
|
|
|
ejaz_pk wrote: What technique should I use to solve this problem?
Diplomacy
The problem is that Access was meant as a desktop-database, not as a grand-central that can update multiple clients with live data. There are multiple ways of telling the other clients that data hath been altered and that they should fetch the fresh ones.
A recordset is a snaphot of data. Once the data changes, you'd either need a new recordset or update the one that you got. Rereading the dataset (with something like a refresh-button) might be the best option.
Alternatively, you could create a new table, that lists the tables in Access together with their last-modification date. If you want data from a table, just look into the new table and see if it has been changed. If it has, again, reread the entire recordset.
Hope this helps
I are troll
|
|
|
|
|
I am using vb as front end and microsoft access as backend database.
What I want is when user close the application it should automatically take the backup of the access database.
How I can solve this problem?
Thanks in advance
|
|
|
|
|
Close all connections to the database and zip & copy it to your backup-location
I are troll
|
|
|
|
|
Write Code in Your Form Closing Event.
Copy your data to another location and Zip It.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
hi,
i am going to learn mysql DB.
i am using .net 2.0
i dont no how to connect mysql DB in .net?
where i download mysql from net?
give me solution for me...
thanks in advance
|
|
|
|
|
Google is broken where you live ? There's a whole site on using MySQL in VB. You sure as hell can find the download by googling it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
hey
Specifically VB and MySQL, there is a very good set of articles there that deal with just that.
You should also have a look at here:
http://www.vbforums.com/showthread.php?t=469872
It deals specifically with connecting to a SQL Database, but the concepts are exactly the same of MySQL.
you may download mysql connector for .net too from following link
http://dev.mysql.com/downloads/connector/net/5.2.html
Hope that helps!!
akhilonly007@gmail.com
|
|
|
|
|
hi,
i am new developer in vb.net.
i have using vb.net2.0 and ms access.
actually i am doing billing project.so i need to print sales page itself.
so how can print page itself ? without going report or report viewer.
example,
customer buy some materials so that time entery the all materials
then print same page itself.now i am doing enter all materials in sales form
then going to report take print out. i dont wont this...
please help for me....
|
|
|
|
|
You should try to create Report Using PrintDocument or DOS Base Printing.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
hi,
i dint get u?
plz give me example.
thanks
|
|
|
|
|
Check the link for Image and Text Printing Using Printdocument.
http://www.codeproject.com/KB/printing/PrintBasics.aspx
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
You Can Use:
Microsoft Visual Basic 2005 Power Packs
its simple and Easy to use
|
|
|
|
|
|
You appear to be fairly clueless to me.
1 - this is a question about ASP.NET
2 - help me pls urgent is not a valid subject, everyone could put that, everyone wants help, and thinks it's urgent. It's not. We don't care about your web app, or your attempts to steal credit for it.
3 - What you've given us is not sufficient to help you if we wanted to. What sort of answer are you expecting ? Go to file x and remove line 32 ? We don't even know what you're using.
You need to get a life. If you use other people's code, they are allowed to claim credit for what they gave you. Removing their logo is a form of intellectual theft, and no-one here will help you do it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I have the following excel 2003 formatting to ask:
I am writing a Visual Basic.Net 2005 desktop application write out data
from a sql server 2005 database to a excel 2003 spreadsheet.
After you look at my questions you can see a portion of the code that I am
currently working with. if you can answer any of the questions below, I would
appreciate it.
I would like to know how to change the following code to do the following:
1. I would like to have the center data in most of the columns including
the column headers.
2. I would like to see all the data in all the cels including the column headers.
3. I would like the last column of the table to 'wraparound' to the next line and
display no more that 75 to 100 characters in a line. (The last column
is varchar(500) due to the messages that could be displayed.)
4. I would like the column headers to be BOLD and the font be Times new Roman
and be able to control the font size.
5. I would like the detail lines to be Times New Roman in a regular font size.
6. Some of the column headers are larger than the detail column. Thus I need the
column headers to wrap. Some of the column headers are larger four words
long. Thus, I do not want the column headers to 'wrap' in the middle of
a word. I would like the column headers only to wrap between words.
Private Sub ShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
Dim xlClApp As Excel.ApplicationClass
Dim excelFile As String = " "
Dim dt As DataTable
Dim da4 As SqlDataAdapter
cnn4 = New SqlConnection(connectionString)
cmd4 = New SqlCommand("stored procedure name", cnn4)
cmd4.CommandType = CommandType.StoredProcedure
With cmd4
.Parameters.Add("@parm1", SqlDbType.VarChar).Value = strParm1
.Parameters.Add("@parm2", SqlDbType.VarChar).Value = strParm2
End With
da4 = New SqlDataAdapter(cmd4)
da4.Fill(ds4)
xlApp = New Excel.Application
xlClApp = New Excel.ApplicationClass
xlApp.Workbooks.Add()
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = CType(xlWorkBook.Sheets("sheet1"), Microsoft.Office.Interop.Excel.Worksheet)
xlApp.Visible = False
xlApp.ScreenUpdating = True
dt = ds4.Tables(0)
'Add the column headings for the from the dataset
Dim dc As DataColumn
Dim iCols As Int32 = 0
For Each dc In dt.Columns
xlWorkSheet.Range("A1").Offset(0, iCols).Value = dc.ColumnName
xlWorkSheet.Range("A1").Offset(0, iCols).Font.Bold = True
xlWorkSheet.Range("A1").Offset(0, iCols).BorderAround()
iCols += 1
Next
Dim iRows As Int32
For iRows = 0 To dt.Rows.Count - 1
xlWorkSheet.Range("A2").Offset(0, iCols).Select()
xlWorkSheet.Range("A2").Offset(0, iCols).Justify()
xlWorkSheet.Range("A2").Offset(0, iCols).WrapText = True
xlWorkSheet.Range("A2").Offset(iRows).Resize(1, iCols).Value = _
dt.Rows(iRows).ItemArray()
xlWorkSheet.Range("A2").Offset(0, iCols).BorderAround()
Next
excelFile = "c:\exceltst.xls"
xlWorkBook.Sheets("sheet1").SaveAs(excelFile)
xlWorkBook.Close()
xlApp.Quit()
xlWorkSheet = Nothing
xlWorkBook = Nothing
xlClApp = Nothing
da4.Dispose()
cmd4.Dispose()
cnn4.Close()
|
|
|
|
|
Most of your questions can be answered by recording macros from with Excel itself, and examining the resultant VBA code. Since you have already created the requisite Excel objects within your application, the VBA code can more or less be directly used in your code, with the correct references.
HTH
|
|
|
|
|
ChandraRam:
I have the following questions to ask you which include:
1. I am not certain of when I can use a recording macro in excel? I basically need to have the visual basic.net 2005 desktop application control the processing since it is the one the drives the generation of separate excel worksheets in distinct workbooks. (There is one worksheet per workbook since each spreadsheet is email and to differet customers.)
2. When I use the recroding macro, when it be before I create the excel object, while I am putting data into the excel object, or after the excel worksheet has been generated?
3. I am not certain where you are refering to using the VBA code. Am I including the VBA code in the following .NET code:
xlApp = New Excel.Application
xlClApp = New Excel.ApplicationClass
xlApp.Workbooks.Add()
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = CType(xlWorkBook.Sheets("sheet1"),
Microsoft.Office.Interop.Excel.Worksheet)
xlApp.Visible = False
xlApp.ScreenUpdating = True
dt = ds4.Tables(0)
'Add the column headings for the from the dataset
Dim dc As DataColumn
Dim iCols As Int32 = 0
For Each dc In dt.Columns
xlWorkSheet.Range("A1").Offset(0, iCols).Value = dc.ColumnName
xlWorkSheet.Range("A1").Offset(0, iCols).Font.Bold = True
xlWorkSheet.Range("A1").Offset(0, iCols).BorderAround()
iCols += 1
Next
Dim iRows As Int32
For iRows = 0 To dt.Rows.Count - 1
xlWorkSheet.Range("A2").Offset(0, iCols).Select()
xlWorkSheet.Range("A2").Offset(0, iCols).Justify()
xlWorkSheet.Range("A2").Offset(0, iCols).WrapText = True
xlWorkSheet.Range("A2").Offset(iRows).Resize(1, iCols).Value = _
dt.Rows(iRows).ItemArray()
xlWorkSheet.Range("A2").Offset(0, iCols).BorderAround()
Next
excelFile = "c:\exceltst.xls"
xlWorkBook.Sheets("sheet1").SaveAs(excelFile)
4. How can I use VBA code here?
5. Here is my code so far:
Private Sub ShowReport_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
Dim xlClApp As Excel.ApplicationClass
Dim excelFile As String = " "
Dim dt As DataTable
Dim da4 As SqlDataAdapter
cnn4 = New SqlConnection(connectionString)
cmd4 = New SqlCommand("stored procedure name", cnn4)
cmd4.CommandType = CommandType.StoredProcedure
With cmd4
.Parameters.Add("@parm1", SqlDbType.VarChar).Value = strParm1
.Parameters.Add("@parm2", SqlDbType.VarChar).Value = strParm2
End With
da4 = New SqlDataAdapter(cmd4)
da4.Fill(ds4)
xlApp = New Excel.Application
xlClApp = New Excel.ApplicationClass
xlApp.Workbooks.Add()
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = CType(xlWorkBook.Sheets("sheet1"),
Microsoft.Office.Interop.Excel.Worksheet)
xlApp.Visible = False
xlApp.ScreenUpdating = True
dt = ds4.Tables(0)
'Add the column headings for the from the dataset
Dim dc As DataColumn
Dim iCols As Int32 = 0
For Each dc In dt.Columns
xlWorkSheet.Range("A1").Offset(0, iCols).Value = dc.ColumnName
xlWorkSheet.Range("A1").Offset(0, iCols).Font.Bold = True
xlWorkSheet.Range("A1").Offset(0, iCols).BorderAround()
iCols += 1
Next
Dim iRows As Int32
For iRows = 0 To dt.Rows.Count - 1
xlWorkSheet.Range("A2").Offset(0, iCols).Select()
xlWorkSheet.Range("A2").Offset(0, iCols).Justify()
xlWorkSheet.Range("A2").Offset(0, iCols).WrapText = True
xlWorkSheet.Range("A2").Offset(iRows).Resize(1, iCols).Value = _
dt.Rows(iRows).ItemArray()
xlWorkSheet.Range("A2").Offset(0, iCols).BorderAround()
Next
excelFile = "c:\exceltst.xls"
xlWorkBook.Sheets("sheet1").SaveAs(excelFile)
xlWorkBook.Close()
xlApp.Quit()
xlWorkSheet = Nothing
xlWorkBook = Nothing
xlClApp = Nothing
da4.Dispose()
cmd4.Dispose()
cnn4.Close()
Thanks!
|
|
|
|
|
I have an app the has a large complex window (it edits documents) that uses Pegasus controls.
On several of my machines the window opens in about 3 seconds.
With one particular customer it takes almost 11 seconds. They have just about the same hardware and O/S as I do (XP, sp 3). I had them install more memory, and that didn't help either.
I have added code to time events down to the millisecond - and have found the problem lies in the creation of the window. Loading the data and images is no problem - the times on all machines is about the same.
Any ideas?
|
|
|
|
|
I tell such people to buy better computers. If it takes that long, it takes that long. Does it take that long every time, or just the first time ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I tend to agree with you. But this has changed between versions of Pegasus controls.
|
|
|
|