snarfblam
Leaders-
Posts
2156 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by snarfblam
-
In order to use the immediate window you must be running an application and be in break mode. The reason that it tries to build your project is so that it can run it to create the environment in which to execute your command. For that reason, the snippet compiler would probably be ideal for you.
-
-
And just to save you some headaches in the future... I don't know where that API declaration came from (probably a website or the VB6 API Viewer), but it is a VB6 declaration, and in VB.Net the long becomes and integer. What you really want is Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Integer) Private Const SLEEPTIME As Integer = 1000 I recommend downloading API Viewer 2004 to avoid these problems in the future.
-
GDI+ is, in certain aspects, sorely lacking in optimization. It is very flexibly: images can be scaled with different options of interpolation and units and vector graphics can be anti-aliased. There are a variety of types of brushes, and on top of all that GDI+ supports transformations (translate, scale, rotate). As a result, though, the most basic graphic operations suffer performance-wise. Even without graphic acceleration, unscaled blits between images with the same pixel format should be lightning fast, as should simple vector operations, but these simple optimizations are missing. GDI+ is, depending on circumstances, notably faster in version 2.0 of the framework, but, sometimes, GDI still manages to put it to shame.
-
private function one() Dim words(50,2) as string Call two(word) end function Private Function two(byval two(,) as string) 'Note the comma End Function
-
system.windows.forms.webbrowser open link same window
snarfblam replied to PROKA's topic in Windows Forms
For starters, look at the NewWindow event. I believe that it is raised (and allows you to cancel) if any kind of popup is going to be shown. As far as intercepting the url to navigate to, I can't help you with that. -
I've written VB7 code that could evaluate an arithmatic expression with trigonometric and exponential functions in the past. If you sit down and really think about it, it isn't all that difficult to code. Precedence can be implemented by layered functions. PerformAddition calls PerformMultiply, which calls ParseValue which parses a constant and returns it to PerformMultiply, which continues calling ParseValue and examining operators, applying the multiplication and division operators until it reaches an operator not at its level of precedence, and returns to PerformAddition, which continues to call PerformMultiply and add the evaluated terms until it finds an operator above its level of precedence. Perentheses equals recursion. (That's a little simplified but you get the idea.) When performance became an issue I wrote a program to extract the constants and store the expression in a tokenized format with the order of operations applied as the expression is tokenized so that what was left was a very simple sort of stack-based bytecode which could be interpreted very quickly. Of course, if you have a ready-made solution or would prefer to use reflection-emit or codedom any of those solutions would certainly work.
-
Look into splash screens. There may be a tutorial here, and I believe that VS comes with a splash screen template.
-
You could open the project file, which should be in an XML format, and fix that file's entry so that it is consistent with the other designer classes, i.e. references its Designer.vb and resx file.
-
I'm not too sure that that was appropriate. If anything my sarcasm makes me a hypocrite. I apologize Diesel, and what's more, I've looked over your last fifty or so posts and these are all your qualities that I think you would make a great admin. Constructive Critisism.
-
What sort of unjust world do we live in, where one so deserving goes unrecognized and overlooked? How can a man's toils be so underappreciated. All the sweat and blood that such a man is to devote to helping and giving support to his fellow man, selflessly, in the face of so many ungrateful souls whose concern is only of their own benefit. Should we not all rise up and give our appreciation to this honorable man who makes his sole purpose the well-being of others? The only just action is the promotion to an Admin! Shall we not all give thanks for the great and magnificent work I have done here today, yesterday, and so many days before? (You didn't really think I was talking about Diesel, did you?)
-
To check if an array is created, compare it to Nothing. To see how many elements are declared for an array, compare to the Array.Length property. Imports System.Windows.Forms Dim MyArray As Byte() Sub CreateMyArray() MessageBox.Show("Creating Array.") MyArray = New Byte() {1, 2, 3, 4} End Sub 'Checking if an array is declared. Sub CheckMyArray() If MyArray Is Nothing Then MessageBox.Show("Array Not Created.") Else MessageBox.Show("Array Created.") End If End Sub 'Checking that a specified index exists Sub CheckElements(Index As Integer) If MyArray Is Nothing OrElse MyArray.Length <= Index Then MessageBox.Show("Index " & Index.ToString() & " does not exist.") Else MessageBox.Show("Index " & Index.ToString() & " does exist.") End Sub 'Demonstration Public Sub Demo CheckArray() CreateArray() CheckArray() CheckElements(3) CheckElements(4) End Sub
-
It should expect a System.Drawing.Image. .Net takes care of all the marshalling, i.e. converting ActiveX types to and from .Net types. But this does sound like an interop issue. Sometimes .Net seems to have some issues with losing transparency data. The files may be stored in .Net in an ARGB format, which ActiveX won't be able to support. If that is the case the Alpha data will simply be tossed out when the bitmap is sent to the ActiveX control. Try changing the ColorDepth property of the ImageList or loading from a different file format (i.e. GIF) if possible.
-
Have you tried... Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" _ Alias "ExtractAssociatedIconA" (hInst As IntPtr, lpIconPath As String, lpiIcon As Integer) As IntPtr You can use System.Drawing.Icon.FromHandle to convert the return value into a .Net Icon.
-
Just to clarify, you are using the wrong byte order. When you write a hex number, you write in most signifigant byte first order, whereas (I believe) in the computer's internal representation (which is what bit converter deals with) numbers are represented as least signifigant byte first, which means that {0x69, 0x87} would actually represent the hex value 0x8769, or 34665.
-
I'm not sure if it is any different for web dev, but if you set everything up right, all you need should be in the appropriate bin folder. Files that should be included should be added to a project with the build action set as "Content." This will cause them to be copied to the output directory. Anything else you need should be embedded as a resource or code. But, again, I'm not sure if it is different for web development. I'd imagine that there could be a lot more files and details involved.
-
How are the icons stored? As resources? As files? The problem could be a marshalling problem, or a conversion issue. Have you tried putting the icons in .NET controls?
-
My goodness, gracious, great balls of fire. VB also has support for DataTime literals if that helps. Instead of quotes you can use number signs... Dim TheThirtyFirstOfMayInNineteenNinetyThree As DateTime = [color=Red]#5/31/1993#[/color] And just to point out...
-
VB.NET 2005: Textbox Cut Copy Paste with Keyboard
snarfblam replied to HardCode's topic in Windows Forms
Are you doing any special key processing (Overriding OnKeyDown/Up/Press or handling KeyDown/UpPress, or anything local to the textbox or global to the app like intercepting messages or using any kinds of hooks, etc.)? -
Firstly, I recommend using the CS tags to make easier reading. Secondly, you could do either of the following: [CS] // If _title and _checkedOut are public or protected... public override string ToString() // from Book Class { return String.Format( "Author: {0} \nISBN: {1}\n Title: {3}\nChecked Out? {4}", new Object[] {_author, _isbn, _title, _Checked Out}); } [/CS] [CS] public override string ToString() // from Book Class { // Use the base keyword to access overridden/shadowed base members return base.ToString() + String.Format( "Author: {0} \nISBN: {1}", _author,_isbn); } [/CS]
-
I haven't used VB6 in a while, so I'm not sure, but would it be possible to just throw a few lines in the VB6 program that can loop through the images in the ImageList and save the images to a file?
-
Well, those are some good points. Maybe you are better off using WSH DLLs after all; I just hate using DLLs. I can't stand dependancy and version issues.
-
Changing Text to bold or a different colour in a listbox
snarfblam replied to UG Guru's topic in Windows Forms
Another option is the ListView control. In "details" view it looks very similar to a ListBox, but allows you to specify fonts and fore/backcolors. The downside is that it takes a little more work to code and it can't contain any type of object except ListViewItem objects (but you could assign their .Tag property to point to the object that they represent if it helps). -
Can you post the code that shows the menu?
-
Is it just me or datagridView is somewhat slow?
snarfblam replied to EFileTahi-A's topic in Windows Forms
EFileTahi, smile a little. I doubt that Xtreme .Net is that hard up for bandwidth, and I'm not sure what kind of answer you were expecting, but a little humor should help with the headaches that the DataGridView causes everyone. The control is, simply put, very slow and from what I understand there isn't much you can do about it. Do a Google search of "DataGridView Slow" and you will see that this topic has already been very thoroughly discussed. If you can use the DataGrid instead, try that. Otherwise all you can do is live with the DataGridView or write your own control.