I'm deploying an application built with VS 2010 Express edition via ClickOnce.
I have associated some file extensions using the options provided in the Publish section of the project's properties.
When I install the application, the associated file extension icons appear normally in Explorer but, when the user tries to open a file in my application, the associated icons appear blank.
The relative code section is the following:
Dim dialog As New OpenFileDialog
With dialog
.AddExtension = True
.CheckFileExists = True
.CheckPathExists = True
.DefaultExt = "pss"
.FileName = String.Empty
.Filter = "Data files|*.pss|All files (*.*)|*.*"
.FilterIndex = 0
.InitialDirectory = MySettings.SavePath
.Multiselect = False
.ValidateNames = True
If .ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
OpenFile(.FileName)
End If
End With
I was always under the impression that OpenFileDialog is a wrapper for Explorer, but for some reason the icons don't appear correct.
Does anyone have any idea how to correct the problem?
Edit: The behaviour is only relevant to Windows 7. Windows XP behaves normally.
I believe you need to set the default view to thumbnail, so that the graphics appear for the pss files. You can check this by manually changing the view to thumbnail while running your application.
If changing the view to thumbnail shows the graphics then check the link below to achieve this:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/571b39c2-0edf-4159-ac8d-1c059f69a978
I forgot to change the included associated icons to:
Build action: Content
Copy to Output Directory: Always
I found this thanks to the manual updates, during which I was getting the error message "Object Reference not set to an instance of an object" during the updateCompleted event.
Related
I have a problem to set up the Browser (CefSharp) language for my application.
So in my Initialization config I already configure it to set the Local Language to German:
Public Sub InitializeChromium()
Dim settings As New CefSettings()
settings.Locale = "de-DE"
If Not IO.Directory.Exists(_cachePath) Then IO.Directory.CreateDirectory(_cachePath)
settings.PersistSessionCookies = True
settings.CachePath = _cachePath
CefSharp.Cef.Initialize(settings)
browser = New ChromiumWebBrowser(address:=lblWEBSiteURL.Text)
pnlBrowser.Controls.Add(browser)
browser.Dock = DockStyle.Fill
End Sub
The strange thing is that when I am starting the application as my project directly in Visual Studio everything works fine. And the pages load with the German preference language. But when I install the same application on the same PC, the pages are loading in English language.
I have tried to set:
settings.Locale = "de"
settings.AcceptLanguageList = "de,de-DE"
and also inserted the Local de.pak (language pak) in my application but still when I install it, it is always on English.
Do you have any suggestions or tips?
I know there is a lot of these noob questions already.
I wrote a small code for display the Icon from a file in a PictureBox and its not working :|
Button6.BackgroundImage = Bitmap.FromHicon(
New Icon(OpenFileDialog1.FileName, New Size(48, 48)).Handle
)
The error says:
Argument 'picture' must be a picture that can be used as a Icon
If anyone know whats the problem, please write it down.
This error means that the file you are trying to open is not an icon. An icon file has extension .ico. Also you need to open the OpenFileDialog1 before geting the selected file name:
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
Button1.BackgroundImage = Bitmap.FromHicon(New Icon(OpenFileDialog1.FileName, New Size(48, 48)).Handle)
End If
I have created a custom task pane in VB.Net for Outlook using the Code given below and I would like to add more content to the header (image and a button) of the User Control instead of just the title. Is there a way I can achieve this?
myUserControl1 = New OutlookTaskPane
myUserControl1.TabStop = True
Dim width As Integer = myUserControl1.Width
myCustomTaskPane = Me.CustomTaskPanes.Add(myUserControl1, "My Custom Task Pane")
myCustomTaskPane.Width = width
myCustomTaskPane.Visible = True
myCustomTaskPane.DockPositionRestrict = Microsoft.Office.Core.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange
Let me know if there is any other way of achieving this please.
Thanks.
Unfortunately the TaskPane header is not customizable. Only Add-in Express supports similar customizations using their implementation of Advanced Form Regions (although only the header icon and header color can be changed and you can't add Windows Forms controls to it). Another option is to implement your own type of Task Pane so you have complete control over the UI; see https://code.msdn.microsoft.com/OlAdjacentWindows/.
Currently I'm new to this and I'm attempting to get this all to work, right now I've looked into and made a module which allows to me to change the user-agent of the internal web-browser so I can manipulate it easily however this is where the issue lies.
I'm assuming I must be editing the auto generated code because the file itself is called "Form1.Designer.vb" and I have no idea where to start putting in custom code to override the current code such as I wanting to do something like this;
Me.WebSiteBrowser1.Dock = System.Windows.Forms.DockStyle.Fill
Me.WebSiteBrowser1.Location = New System.Drawing.Point(3, 3)
Me.WebSiteBrowser1.MinimumSize = New System.Drawing.Size(20, 20)
Me.WebSiteBrowser1.Name = "WebSiteBrowser1"
Me.WebSiteBrowser1.Size = New System.Drawing.Size(671, 413)
Me.WebSiteBrowser1.TabIndex = 0
ChangeUserAgent("This is after the url agent gets changed after the first url open")
Me.WebSiteBrowser1.Navigate("http://www.whatsmyuseragent.com/", Nothing, Nothing, "User-Agent: This is the first open url agent")
However whenever I change anything in the visual template it automatically resets back to
Me.WebSiteBrowser1.Dock = System.Windows.Forms.DockStyle.Fill
Me.WebSiteBrowser1.Location = New System.Drawing.Point(3, 3)
Me.WebSiteBrowser1.MinimumSize = New System.Drawing.Size(20, 20)
Me.WebSiteBrowser1.Name = "WebSiteBrowser1"
Me.WebSiteBrowser1.Size = New System.Drawing.Size(671, 413)
Me.WebSiteBrowser1.TabIndex = 0
So my question is where do I write the custom code that would allow me to keep that after the auto-generation from the visual creator?
You should be putting your code in the form1.vb and leave the designer file alone. In the form1.vb[Design] you can change the properties in the properties window. If it is not currently docked to the right side of the VS designer you can show it by going to the Menu -> View -> Properties Window and select it.
I am creating silverlight application and integration Quickbooks data using QBFC.
I am browsing company database name from silverlgiht application which is opened in Quickbooks. When i do that i am getting error like File in use.
How can I get file name from browse button which is opened in Quick-books.
I have followed below code to start the quick-book secession.
sessionManager.OpenConnection( "", "Account sample" );
sessionManager.BeginSession( Filename, ENOpenMode.omDontCare );
The BeginSession call should be replaced with the file name that the user selected with your open file dialog. I would also suggest using OpenConnection2 if you're using the newest SDK. Here's a sample, though I've not really used Silverlight:
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "QuickBooks Files (*.qbw)|*.qbw";
if(dlg.ShowDialog() == true)
{
sessionManager.OpenConnection2("","Account sample", ENConnectionType.ctLocalQBD);
sessionManager.BeginSession(dlg.File.FileName, ENOpenMode.omDontCare);
}