|
Cool man! I love your reply. It really challenges me to be more careful next time when I post my question. I should clearly state what my input should be. I guess right now you should figure out I want to have three parameters. First one is a directory name. Second one is also a directory name. The last one is a special string.
|
|
|
|
|
|
It's not the quotes that are screwing it up, it's the backslashes. You don't normally see directory paths specified with a trailing backslash. You can put any filepath you want inside double quotes, even if there are no spaces in the path.
|
|
|
|
|
Thanks. Finally someone can help out.
|
|
|
|
|
A single backlash in front of a quote character makes the parser treat that character as part of the string rather than a separator.
|
|
|
|
|
Thanks. Finally someone can help out.
|
|
|
|
|
hey friends,i have a problem about my program...
i have just make a simple web browser,but i think it is very simple...
can you tell me an opinion about advanced browser features?
|
|
|
|
|
You might want to describe what kind of opinion you're looking for and define what you think is an "advanced browser feature".
BTW, dropping the WebBrowser control on a form is not making your own "simple browser". All you're doing is embedding Internet Explorer into your app. You haven't actually "made a browser".
|
|
|
|
|
I have been using VS2008 on XP for some time now, converting a project to VB.net. I have it largely converted and am debugging now (i.e. the project is running fine)
I am trying to move it to Windows 7 (finally). I installed the exact same visual studio I am using on XP, and I copied the project directory from the old computer to the new computer.
For some reason I loose a few references so on the reference page I add them back in, there were three of them, all custom references. The reference dialogue tells me it can not find the files specified, on the XP machine they are listed as being in \project\obj\release directory, so on the Windows 7 machine I point to them there (not sure if I should do that or point to the original)
When I try to run or debug the project I get the following errors and it stops.
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in MBIG.exe
A first chance exception of type 'System.TypeInitializationException' occurred in MBIG.exe
A first chance exception of type 'System.TypeInitializationException' occurred in MBIG.exe
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in MBIG.exe
The program '[2776] MBIG.vshost.exe: Managed' has exited with code 0 (0x0).
Anyone have any suggestions as to what I should do to resolve or identify the problems? (not sure it the references impact this or not)
no-e
|
|
|
|
|
Add those .DLL's projects to this one and you can add a project reference instead of a file reference. That way, the .DLL projects will be recompiled (if needed) and any changes automatically propogate through to your application without screwing up the references.
You will also have to go back to those .DLL's projects and make sure they compile and work as intended. They might have dependencies that have changed on Windows 7 or on projects you have no copied over.
Judging by the error messages you posted, the .DLL's you're referencing may need to be registered on the machine, i.e: REGSVR32.
|
|
|
|
|
Dave,
Thanks for the response, that appears to have put me in the right direction. I registered them, deleted interop.XXX files in question, added references to the proper dll files and it worked for two, it appears that it creates the interop.xxx files in the \obj\debug and \obj\release directories... at least for two of them.
When I debug, it tells me it cant find the "interop.xxx3" file. If I look at references it lists the original DLL file for the one it can't find (the other two changed to indicate the interop.XXX and interop.xxx2
Can you give me a bit of guidance on how this is supposed to work? I could not find much in the way of background on the web. Is there a way to force it to create these files?
no-e
|
|
|
|
|
Not sure about the full answer but when moving projects in this way you should only move the directories containing source code, and rebuild everything from scratch in the new location. Try doing a clean of your project, delete all obj and bin directory trees, reset all references to ensure they point to the correct DLLs on the new machine, check your project dependencies (if any), and then try building the project(s) again.
|
|
|
|
|
Hi all
I have a two Input data of Year and Name in separate two arrays. I need to sort both the array values first i need to sort it chronologically(Year) and then if year information repeats it will sort the Array Alphabetically.
As for as i complete the sorting for both year and then name. Using Wordbasic.sortarray command
Input: (Before sorting)
SDF 1997
ELS 1986
PJK 1983
WKL 1995
EFD 1986
Output: (After sorting)
PJK 1983
EFD 1986
ELS 1986
WKL 1995
SDF 1997
if i print it in word it printed like this:
PJK 1983, ELS 1986, EFD 1986, WKL 1995, SDF 1997.
Here is my code for Printing the data. Would anyone please look into this and guide me where did i made mistake?
WordBasic.sortarray SortyearArray()
Dim I As Integer
Dim J As Integer
Dim K As Integer
Dim N As Integer
Dim Counter As Integer '
COUNTER1 = 1
i1 = 1
J1 = 5
For I = 0 To UBound(SortyearArray())
Counter = 1
For J = I + 1 To UBound(SortyearArray())
If SortyearArray(I) = SortyearArray(J) Then
Counter = Counter + 1
MsgBox (Counter)
End If
COUNTER1 = Counter + COUNTER1
Next J
If Counter = 1 Then
For N = i1 To J1
If SortyearArray(I) = Year(N) Then
Selection.TypeText Text:="(" & AuthorName(N) & Year(N) & ")"
End If
Next N
End If
Next I
Anyone please guide me to complete this.
Dk.G
|
|
|
|
|
godevg wrote: Selection.TypeText Text:="(" & AuthorName(N) & Year(N) & ")"
Looks like you are missing a linefeed somewhere?
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
is it possible to limit picturebox picture size?
i've searched all day in google, they're all limitation in width and height, the size limit i mean is like 500KB or 1MB.
|
|
|
|
|
Pictures can't be limited in file-size by loading them; you can't load half a picture and decide that you had enough, since it would be only half-a-picture.
Load the image, resize it (width and height), reduce colors, save it in a different format; those are ways to reduce the file-size.
Bastard Programmer from Hell
|
|
|
|
|
When I am scrolling datagrid after selecting one row I am getting error as "An unhandled exception of type System.StackOverflowException occurred in System.Windows.Forms.dll" on line :
MyBase.Edit(source, rowNum, bounds, [readOnly], instantText, cellIsVisible)
Whole code is given below :
' Hosts a TextBox control in a cell of a DataGridColumnStyle for editing strings.
'
' Note:
' Adds the ability to change the color of an individual cell. As each row in the column is
' painted an event is fired that allows the setting of the new color.
' Added returning the cell value when it's being painted. Also if the row is selected the
' selection colors will be used.
'-----------------------------------------------------------------------------------------------'
' Additional namespaces.
Imports System.Windows.Forms
Imports System.Drawing
Public Class FormatableCellDataGridTextBoxColumn
' Base class.
Inherits DataGridTextBoxColumn
' Delegates.
Public Delegate Sub PaintingCellEventHandler( _
ByVal sender As Object, _
ByVal e As PaintingCellEventArgs)
Public Delegate Sub EditingCellEventHandler( _
ByVal sender As Object, _
ByVal e As EditingCellEventArgs)
' Events.
Public Event PaintingCell As PaintingCellEventHandler
Public Event EditingCell As EditingCellEventHandler
' Instance variables.
Private _columnNum As Integer
Public Sub New(ByVal columnNum As Integer)
' Initialize instance variables.
_columnNum = columnNum
End Sub
Protected Overloads Overrides Sub Paint( _
ByVal g As System.Drawing.Graphics, _
ByVal bounds As System.Drawing.Rectangle, _
ByVal source As System.Windows.Forms.CurrencyManager, _
ByVal rowNum As Integer, _
ByVal backBrush As System.Drawing.Brush, _
ByVal foreBrush As System.Drawing.Brush, _
ByVal alignToRight As Boolean)
' Local variables.
Dim foreColor As Color
Dim backColor As Color
Dim rowIsSelected As Boolean = False
Dim text As String = NullText
Dim value As Object = GetColumnValueAtRow(source, rowNum)
Dim arg As PaintingCellEventArgs
' Determine if the row is selected.
If TypeOf foreBrush Is SolidBrush AndAlso TypeOf backBrush Is SolidBrush Then
foreColor = DirectCast(foreBrush, SolidBrush).Color
backColor = DirectCast(backBrush, SolidBrush).Color
If _
foreColor.Equals(DataGridTableStyle.SelectionForeColor) AndAlso _
backColor.Equals(DataGridTableStyle.SelectionBackColor) Then
rowIsSelected = True
End If
End If
' Retrieve brushes.
If Not IsDBNull(value) Then text = value.ToString()
arg = New PaintingCellEventArgs( _
rowNum, _
_columnNum, _
text, _
backBrush, _
foreBrush)
If Not rowIsSelected Then RaiseEvent PaintingCell(Me, arg)
' Paint the cell.
MyBase.Paint(g, bounds, source, rowNum, arg.BackBrush, arg.ForeBrush, alignToRight)
End Sub
Protected Overloads Overrides Sub Edit( _
ByVal source As System.Windows.Forms.CurrencyManager, _
ByVal rowNum As Integer, _
ByVal bounds As System.Drawing.Rectangle, _
ByVal [readOnly] As Boolean, _
ByVal instantText As String, _
ByVal cellIsVisible As Boolean)
' Local variables.
Dim editBoxIsToBeHidden As Boolean = False
Dim e As New EditingCellEventArgs(rowNum, _columnNum, editBoxIsToBeHidden)
' Retrieve edit instructions.
RaiseEvent EditingCell(Me, e)
' Allow the call to progress normally.
MyBase.Edit( _
source, _
rowNum, _
bounds, _
[readOnly], _
instantText, _
cellIsVisible)
' Hide the edit box.
If e.EditBoxIsToBeHidden Then
Me.HideEditBox()
End If
End Sub
End Class
|
|
|
|
|
First, if you're going to post code put it inside PRE tags so it's retains it's formatting and is readable.
Second, there are no definitions for PaintingCellEventArgs and EditingCellEventArgs, so we have no idea how you're getting values from the client code.
We also have no idea what the client code looks like that is filling it these values.
...and I can't quite put my finger on it, but as it stands, this code looks a bit ... funky.
|
|
|
|
|
I'm just stuck here ...
Given:
Dim i As Integer = 1
Debug.Print(i.ToString("000"))
What I can't seem to figure out is the correct format string to be used with .ToString to give me two spaces then the number 1. (which would be right aligned)
|
|
|
|
|
I use string.PadLeft() to right-align some text...
|
|
|
|
|
PadLeft is the winner.
Just what I was looking to do.
Thanks,
david
|
|
|
|
|
Composite formatting using indexed placeholders "{0}" allows for alignment but standard formatting with the ToString method does not.
Example of alignment in a fixed width field
Console.WriteLine("{0, -4}", 99);
Console.WriteLine("{0, 4}", 99);
Debug.Print has an overload for composite formatting so you can do the same trick.
Alan.
|
|
|
|
|
String.Format will do what you want for creating strings.
|
|
|
|
|
Don't think there is one! You'd have to create a string and add leading spaces according to its initial length.
|
|
|
|
|
Good day, i have an application which can upload and preview image files, e-presentations, word duments, excel files and pdf files. On my program i used Web Browser Control and I'm planning to change the component or upgrade the software. Aside from Web Browser Control, what else can I use to preview those file types? Any suggestions and comments will be appreciated.
darylljoecanan™
|
|
|
|