C# - Understanding Ownerdrawn Listbox + OwnerDrawVariable Property

Jul 23, 2010

I have this code for an ownerdrawn list box that is repainting too frequently. It seems to be related to trying to scroll an event with a different height than normal. Here is the 'smallest code to reproduce the problem' that can be pasted into a blank form (erase the designer file) - VB version (c# of course does the same thing):

[Code]...

View 3 Replies


ADVERTISEMENT

Creating An Ownerdrawn Dtp?

Oct 24, 2010

how would i go about creating an ownerdrawn dtp, with highlighted dates in the dropdown + also in the collapsed view when a highlighted date is selected?i'm guessing i'd have to inherit a dtp + then handle an event or 2.

View 3 Replies

ComboBox Set To OwnerDrawVariable Causes Item Text Mis-encoding End Displaying Blocks?

Apr 30, 2012

I have a problem with combobox. I set the DrawMode into OwnerDrawVariable so I can draw items seperately with styles, but the characters of the items are now displaying blocks. The block characters are none ASCII. It used to display well but not now and I don't know what caused it to happen. I didn't change my system locale. At the same time, other combobox that have Normal DrawMode displays nicely fine.

My custom drawing code:

e.Graphics.DrawString(combo.Items(e.Index), combo.Font, b2, rect.X, rect.Y)

View 6 Replies

Ownerdrawn Tabcontrol - Can't Change Selectedindex In Code?

Mar 4, 2012

i modified my tabcontrol, to change the tab forecolor, which worked but now when i try to change selectedindex in code, the correct tab is highlighted but the tabpage doesn't change. if i minimize + restore the form, the previous tab is highlighted...

View 6 Replies

Getting Used To The New Listbox Property?

Aug 19, 2009

Im in Vb.net and it took a little getting used to the new listbox property, but I got it now. I am storing self created objects that contain a key and a string. THe problem is that the key is not sorting,
The values are something like

3E-1
3E-11
3E-12
3E-2

I have tried putting it into an arraylist first, then sorting, but same order. Any ideas??
thks

View 6 Replies

Which ListBox Property To Use

Apr 1, 2009

Which ListBox property do I use to get the ListBox on my form to show the desiredCollection item?

Dim i As Integer
i = 9
lbxBiz_Mon_Start.Items.IndexOf(i)

[code].....

View 4 Replies

Asp.net - Listbox.SelectedIndex Is Not Changing After Some Asp Property Changes?

Jun 14, 2012

I have a form with a dropdownbox two listboxes and two buttons on it. I removed a "select" button as I just used the DropDownList1_SelectedIndexChanged, but the event would not fire until I used the suggestion from:Why DropDownList.SelectedIndexChanged event does not fire?

It involved changing the AutoPostBack='true' and EnableViewState="true" properties

So now the DropDownList works but with the two listboxes, the SelectedIndex stays as -1 and does not change even when selected.

[Code]...

I think it has something to do with post backs, page_load or the selectedindex changed event of the listbox, it worked perfectly before I made the modifications.

View 1 Replies

Understanding The PDF DOM

Apr 29, 2011

I am writing an application that has to read and interpret data stored in some PDF files. The reading part is done but I am only able to get a dump of all the words on a page and not the format of the words. What I mean is that if I have to extract a table, I am getting the numbers in the table but not the markup which defines the table.

Further, there is some formatting used which displays a few of these numbers within parentheses (meaning that those numbers are negative) but the parentheses themselves are not part of the text. Hence, I am not able to distinguish between positive and negative numbers present in the PDF table!

How do you get the PDF markup along with the text? Is a PDF similar in structure to an XML with tags used to markup tables etc.? If not, then, is there a resource which describes the salient features of the PDF DOM? I am using VBA and the Acrobat library (AcroExch etc.)

View 4 Replies

VS 2010 Add A Property To The Default ListBox Control?

Jun 23, 2010

I have been trying to create a custom control based on the ListBox called FileListBox. I followed Microsoft's walkthrough but am having some trouble.

What I want is to add another property to the ListBox called SafeItems which is an ObjectCollection of strings (like the Items property). I will use the Items property to store a collection of Filenames as strings and I would like to store the corresponding SafeFilenames in the SafeItems collection.

This is what I've tried:

FileListBox.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FileListBox
Inherits System.Windows.Forms.ListBox

[Code].....

View 6 Replies

Understanding And Using Predicates

Dec 7, 2009

I am trying to use my first predicate and I generate the error:Method 'Public Function FindIndex(list As MyProgram.HTMLFiles) As Boolean' does not have the same signature as delegate 'Delegate Function Predicate(Of T)(obj As String) As Boolean'.[code]

View 12 Replies

Understanding RTF And Edit It

Mar 15, 2010

I have this RichTextbox in my vb.net form and I would like to when a user click a button, for example to embold the selected text, how would I do this.Also, I do NOT want to use the standard vb.net expressions such as RichTextBox1.SelectedText.Font.Bold = true. I want to do something like RichTextbox1.SelectedRTF="[bold]" & RichTextBox1.SelectedRTF & "[/bold]" or whatever RTF looks like.Can I just add the RTF options random places or can a RichTextBox return an error if the text is in wrong format. I'm mostly looking for info on how to work with RTF without using the standard vb expressions.

View 1 Replies

Understanding Use Of DWORD

Jun 16, 2010

My goal is to read a data streaming from a machine the streaming is divided in tre main parts,the first is a 10 byte array that declare the length of the second and third part.The second one, the header, is a 22 DWORD (*32bit) ( 88 byte ) structured of mixed data types.I can easly read the value inside this header when the DWORD contains just one information using something like: [code] My problem starts because some of these DWORD contains several indipendent informations, for example DWORD #4 [ channel 2 peaks 31..16] [channel 1 peaks 15..0].For what I understood the first 16 bits ( so 2 bytes) are used to store the information of the first channel , while the second 16 bits are used for the second channel, I tryed converting the first 2 byte with System.BitConverter.ToUInt16()but without success.Can someone explain me what to do and how these numbers are supposed to be stored?

View 6 Replies

How To Pick Random String From Listbox And Show In Property

Mar 4, 2010

I am not so good at VB.NET, well, I am working with a school to run a Spelling Bee aimed at children in year 7. And to make it fair and unbiased i need an application that can choose randomise a word from the list box then transfer the string to the text box. So basically something that can pick a random string from the listbox and show it in the textbox1.text property.

View 4 Replies

IDE :: IntelliSense Shows () After Count Property For ListBox.Items?

Apr 21, 2009

I am a student in a Visual Basic class. We were working on a project using the Count property of the ListBox. I'm using Visual Studio Professional Edition 2008. When I enter a line in the editor that looks something like this: If lstResults.Items.Co

IntelliSense will generate a little balloon that says 'Public ReadOnly Property Count() I saw the () after Count and thought that meant that was the proper way to code it. So that is what I did. The code seems to work with ...Count() or just ...Count. I was wondering if there is some reason why the parens show up after the description of the Property in IntelliSense.

View 3 Replies

Stuck Understanding OO Concepts?

Dec 14, 2010

so i have a class called FOOTBALL,then another 3 classes/forms that inherit FOOTBALL, they control score (SCOREBOX), possession (POSSBOX), and quarter (QUARTERBOX).the FOOTBALL class has 4 variables, "score" (array of 2 ints), "teams" (array of 2 strings), "possession" (boolean), and "quarter" (int)after that i have another form called MAINBOX, which creates new instances of the 3 classes (SCOREBOX, POSSBOX, and QUARTERBOX) (like this: private scoring = new SCOREBOX)... however they all technically create their own FOOTBALL classes, so I cannot connect them.

View 4 Replies

Understanding Event Statement?

May 29, 2009

I started out with VB.NET but now mostly do C#. I never really got to grips with events in VB. I'm trying to translate an old VB.NET program (from 2002) into C#. I've dealt with everything apart from statements such as these:

Public Event UpgradeProgress(ByVal strProgressString As String, _
ByVal strCurrentFile As String, ByVal intProgressPercent As Integer, _
ByVal lngTimeRemaining As Long, ByRef blnCancel As Boolean)

[code]....

View 4 Replies

Understanding In-memory Compiling

Feb 27, 2010

It is my understanding that in .Net 4.0, VB will have an in-memory compiler.

I have to admit I don't know a lot about the compilers so I'm trying to understand the advantage of this as compared to what we had before this. Also, will C# be coming out with the same type of compiler?

View 2 Replies

VS 2008 Understanding HtmlElementCollection?

May 25, 2012

I'm confused on the results of this code. The results extracts the tag "div" but why isn't the results containing the word "Yoga"? Shouldn't the result have only one element because it should exit the for loop after finding the first element? The results show hundreds of elements

Dim ElementCollection2 As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("div")
For Each curElement As HtmlElement In ElementCollection2

[code].....

View 4 Replies

Annotating Some Code And Understanding What Arrays Are Doing?

Dec 1, 2011

I wanted to know what the main areas are and what the array is actually doing in the code. I know that dim is declaring the variables, but how do i exactly explain this code line by line.

PS: the areas in red are the main areas im trying to understand annotate.

Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub

[code]....

View 4 Replies

Homework - Net Abstract Class Understanding?

Dec 28, 2011

If i have a class called A and a class called B, if B inherits A that means A is the super class and B is the subclass. I have been asked to describe why class A is not an abstract class but as i see it class A is an abstract class A, as it has been created for Class B to use in the future, is it something to do with Class B not being able to access the fields in Class A as although they are private by default?

[Code]...

View 3 Replies

Multithreading - Understanding The Way Application.Run() Works?

Nov 4, 2010

As far as I understand from the docs, it seems that Application.Run() starts a message loop on the current thread, which in turns enables it to process user input (Is that right?).The overloaded version Application.Run(Form) basically does the same, only it exists when the form closes, and it shows the form by default.timer ticks after 20mns, and has to execute say approx. 15 tasks one by one, every time creating an instance of a progress dialog, initially hidden in the taskbar.

View 1 Replies

Understanding AndAlso - Get A Runtime Error?

Oct 5, 2011

Looking at the following code snippet in VS2008 (this is from the SBS book)

Dim HumanAge As Integer = 0
If HumanAge <> 0 And 7 / HumanAge <= 1 Then
MsgBox("1 dog year or older")[code]....

I expect to get a runtime error, because And evaluates both conditions, which is why in this case AndAlso should be the better operator to use. When I try this code there is no difference in behavior between 'And' & 'AndAlso'. In neither case I get a
runtime error, not even when I flip the conditions around. Is this by design, a lucky accident, or do I just not get it?

View 5 Replies

Understanding ItemsSource And DataContext In A DataGrid?

Jun 14, 2010

UPDATE: See the bottom of this question for what I did to solve the problem.I'm trying to understand how the ItemsSource and DataContext properties work in a Silverlight Toolkit DataGrid. I'm currently working with dummy data and trying to get the data in the DataGrid to update when the value of a combo box changes.

View 2 Replies

Understanding Object Aggregation And Databases

Aug 24, 2010

I have a situation in a program I'm writing where I'm not sure of the best way of coding a couple of objects and was hoping for a few pointers.I am using VB.NET 2003, so F/wrk v1.1. My business is horticultural in nature and I'm trying to help streamline the business with a new order fulfillment app.In my program, I have products. Some products don't have any component parts, but others are made up of a selection of plants.For example: we sell a trowel, which obviously doesn't have any component parts. But we also sell a large vegetable garden, which is made up of, say, 20 rocket plants, 30 salad plants, 5 spring onions, etc.[code]I believe the ProductContents table is technically referred to as a 'join table'?

I have written the classes in VB.NET which load, save, edit the Products and the Plants. I also have Manager classes which store collections of these objects (ProductMgr, PlantMgr).I have dealt with situations before with join tables where there are only two columns which are both FKs and both make up a composite PK (ie - to express a one-to-many relationship). This is pretty straightforward (using my product/plant tables as an example) because when I load an individual Product from the database, I also run a second SELECT query which returns any PlantIDs associated with that PlantID from ProductContents. I store that in an array of integers within the Product object. I can then load Plants from the PlantMgr object based on the PlantIDs stored in this array. I kind-of do the reverse when I save the Product to the database, I run a second INSERT query which updates the ProductContents table with the Plants associated with the Product.Where I'm getting stuck is with the inclusion of the extra 'Quantity' column. I can no longer store the PlantIDs in an array of Integers because I also need to store the Quantity associated with that Plant. I also can't use the PlantMgr object any more (to express which Plants are in each Product) because it also doesn't include any information about Quantity.I was just wondering if there is a standard way of handling this kind of situation, where I have a 'join table' which also includes extra columns as well as the two columns that identify the join.

View 1 Replies

Understanding Why FTP Upload Doesn't Work?

Apr 3, 2012

I'm trying to figure out why the following VB.Net code seems unable to upload a file to my ISP's FTP server, since it doesn't report any error but I'm not getting the notification e-mail I'm supposed to receive once a file has been uploaded.So I launched the free Fiddler proxy on 127.0.0.1:7777, but it doesn't report any activity, even with its "Capture FTP Requests" option checked:[code]Is there a way to watch the FTP session to understand why the file seems to be uploaded successfully but I'm getting no success notification?

View 4 Replies

Understanding Xml - Saving, Loading, Manipulating?

Aug 15, 2009

a member mentioned, xml is similar to a txt file. txt files, i can manipulate quite well. so, if this is the case, it should not be to complicated to do as the thread title describes . that, of course is, if you already know how to even create an xml file. i do not. any and all input/suggestions welcomed, links for xml noobing welcomed as well.

i like: VB General google fast cars username password

View 11 Replies

VS 2010 : Understanding A Tick Method?

Nov 27, 2011

I am working on a project, but the latest enhancement to it has me stumped currently. Here is what the class enhancement asks for:

Modify class time to provide a Tick method that increments the time by one second. Also provide methods IncrementMinute to increment the minute and methods IncrementHour to increment the Hour. The Trick method, the IncrementMinute method and the IncrementHour method should be called when you click the Add 1 to Second button, the Add 1 to Minute button and the Add 1 to Hour button, respectively. Be sure to test the following cases:

A) Incrementing into the next minute.

B) Incrementing into the next hour.

C) Incrementing into the next day (that is, 11:59:59 PM to 12:00:00 AM).

Here is my GUI:

The reason I am confused is currently my program already increments the seconds, minutes, and hours correctly (as shown in pic) for Cases A, B, C. But, I haven't added a Tick method which is what the enhancement to the class Time calls for. Here are the 2 classes I have so far:Time Class that the Tick method is supposed to be added to

Public Class Time
' declare Integer instance variables for the hour, minute and second
Private hourValue As Integer ' 0 - 23
Private minuteValue As Integer ' 0 - 59

[code]....

View 2 Replies

.net - Understanding AddHandler And Pass Delegates And Events

Mar 17, 2010

I am using AddHandler to wire a function to a control's event that I dynamically create:

[Code]...

This code is generating a run-time exception stating: Unable to cast object of type 'MyEventHandlerDelegate' to type 'System.EventHandler' What am I not understanding about System.Delegate even though AddHandler takes as an argument of type "System.Delegate"? What Type does "EventHandler need to be to cast to a type that AddHandler can accept?

View 3 Replies

C# - Understanding Floating Point Limitations In Calculations

Jan 12, 2011

How to determine when floating point limitations will cause errors in your calculations. For example the following code.
CalculateTotalTax = function (TaxRate, TaxFreePrice) {
return ((parseFloat(TaxFreePrice) / 100) * parseFloat(TaxRate)).toFixed(4);
};

I have been unable to input any two values that have caused for me an incorrect result for this method. If I remove the toFixed(4) I can infact see where the calculations start to lose accuracy (somewhere around the 6th decimal place). Having said that though, my understanding of floats is that even small numbers can sometimes fail to be represented or have I misunderstood and can 4 decimal places (for example) always be represented accurately.

MSDN explains floats as such... This means they cannot hold an exact representation of any quantity that is not a binary fraction (of the form k / (2 ^ n) where k and n are integers). Now I assume this applies to all floats (inlcuding those used in javascript). How can one determine if any specific method will be vulnerable to errors in floating point operations, at what precision will those errors materialize and what inputs will be required to produce those errors?

View 5 Replies

Understanding Eprom Emulator Command String

Sep 19, 2011

I'm working with an eprom emulator in trying to understand the command string write instructions. Here is what I have. [code] From what I know, the values in hex need to be converted to decimal first. What I'm not sure about is the checksum value needed. The instructions say Checksum =(1 byte truncated addition of all the above).

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved