Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




COLORMAP With More Than One Entry (GDI+)


Is it possible to have either an array of COLORMAPs or a COLORMAP with an array of oldcolor-newcolor enties? I need to replace serveral colors. This work fine with subsequent calls to the ReplaceColor Function, but is surely not the right way to do it...

Code snip (is a modified function of the "MakeTransparent" funktion in cBitmap from OnErrOr)

Code:
Public Function ReplaceColor(ByVal OldColor As Long, ByVal NewColor As Long) As Long
Dim bmp As cBitmap
Dim gfx As cGraphics
Set bmp = New cBitmap
Set gfx = New cGraphics
Dim rc As RECT
Dim lAttrib As Long
Dim ReMapTab As COLORMAP
Dim lTmpHandle As Long

ReMapTab.NewColor = NewColor
ReMapTab.OldColor = OldColor

If bmp.CreateFromScan0(m_lWidth, m_lHeight, 0, PixelFormat32bppARGB, 0) = Ok Then
If gfx.GetGraphicsContext(bmp.Handle) = Ok Then
If gfx.Clear = Ok Then
rc.Right = m_lWidth
rc.Bottom = m_lHeight

If GdipCreateImageAttributes(lAttrib) = Ok Then
If GdipSetImageAttributesRemapTable(lAttrib, ColorAdjustTypeDefault, 1, 2, ReMapTab) = Ok Then
If gfx.DrawImageRectRectIAttr(bitmap, 0, 0, m_lWidth, m_lHeight, 0, 0, m_lWidth, m_lHeight, lAttrib) = Ok Then
...
I have tried with:
Dim ReMapTab(0 to 10) As COLORMAP
but this gives me a type mismatch error?!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Check If Your Next Entry Is Equal To The Previous Entry
hi,
im doing an accounting system where i can input my transaction debit and credit...as we all know, these values must be equal as entered..now i want to trap whether the user input another value other that what he input on the previous entry...

here's my code:


Code:


Private Sub cmdOK_Click()
Dim dcRS As New ADODB.Recordset

strSQL = "Select * from tblEntry Where TransID like '" & trans_id.Caption & "'"
Call SelSQL(strSQL, dcRS)

If optdebit.Value = True Then
dcRS.AddNew
dcRS!TransID = trans_id.Caption
dcRS!Entries = txtTitle
dcRS!Debit = txtAmount
dcRS!Credit = 0
dcRS.Update

ElseIf optcredit.Value = True Then


dcRS.AddNew
dcRS!TransID = trans_id.Caption
dcRS!Entries = txtTitle
dcRS!Debit = 0
dcRS!Credit = txtAmount
dcRS.Update

End If

MsgBox "Transaction saved", vbInformation
Set DataGrid1.DataSource = dcRS

Private Sub Form_Load()
Dim lRS As New ADODB.Recordset

Call DataOpen(goConn)
Call LoadDataComboBox("tblAccountEntry", dbCode)

strSQL = "Select * from tblEntry Where TransID like '" & trans_id.Caption & "'"
lRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic

If Not lRS.EOF Then lRS.MoveLast
Set DataGrid1.DataSource = lRS

End Sub

End Sub


in this code i can input the data but i cant seem to trap the value of the debit if it is equal to credit on my next entry...my controls are optcredit,optdebit (radio buttons), txtamount and a command button....anyone can show me how?? thanks

Reg. Entry
I have a form with a combo box. I would like to give the user the oppertunity to add and remove items to the list . I already have a setting for another item being saved to the Registry but I'm not sure how to code it to a combo box. This is what I have for one of other settings, could someone help me modify this to the combo box.

SaveSetting "Max Workout Program", "Startup", "Intro", CStr(mnuIntro.Checked)

Dim intLastEntry As Integer
mnuIntro.Checked = CBool(GetSetting("Max Workout Program", "Startup", "Intro"))

My combo box is called ExerciseInput.

DSN Entry
Hi,

How would I create a DSN entry programmatically.

I know the SQL Server name, but I have to be able to do it programmatically.

thanks,

Last ADO Entry
If I don't have any specific field that I can search for, how can select the last entry from a database table using ado.

Thanks in advance.

Datagrid Entry
hi all,
i am a newbie .I am developing an application which needs to enter data directly into the grid .I am fed up of doing lengthy coding. So please suggest me any alternative for it or any thirdparty control(free) that offer this facilities( to directly enter data into the grid).
i hope this forum has some solution to my problem.
ThankYou in advance !

Set An Entry In Thr Regsistry
Hi, hopefully someone will be able to assist. In the registry on a users logon I want to be able to set the current printer=to a speicifc value.

I can get a list of the printers installed on the system, but I'm using Dymo printers for various label types, what I want to do is set the CurrentPrinter value=to the printer I want to use.

In registry the value I need to change is under the following structure

HKEY_CURRENT_USER
Software
DYMO
LabelWriter
Settings
Current Printer

I need the command to set the value of current printer in the sturcture provided above.

Can anyonehelp, thanks

New Registry Entry
How do i create a new registry entry with my program?

Entry Level Job Available
I don't know if this is legal to do this--if this thread doesn't belong here, let me know and I'll delete it.

My company is looking for another programmer. Preferrably one that has experience with DirectX or OpenGL, and knows their way around VB/C++.

Take a look at the job posting:

http://www.jobtarget.com/candidates/...d&t emp_id=16

DLL Entry Point
I'm very very new to dlls. Getting an entry point error. Any ideas?

I'm using excel

Validation On Entry Of [hh]:mm
Hi there. I got an userform containing two fields namely "time-off from"(textbox1) and "to"(textbox2). The format of both field is "hh:mm" it is expected user must key in the value in the required format. I tried the following vba codes but was unable to achieve the expected result.


Code:
timeoff_hr = textbox1.value - textbox2.value 'the earned time-off hours
if textbox1.value <> format(textbox1.value,"hh:mm") or textbox1.value <> format(textbox1.value,"hh:mm") then
msgbox "Invalid format of time-off hours claimed! Press 'OK' to try again."
else
range("a1") = timeoff_hr
endif

Any advice please.
Cheers.

Need Help! Invoicing Entry
I am newbie in VB, I am task to create a simple invoicing program that the fields are:

date, customer name, item, quantity, UP, total

invoice number - should be unique to each other.

The program will able to generate reports like:

Daily Sales Report (Quantity Item Sold)

I need any leads or link how to start.

Looking forward to hear from you guru.

John

How Do I Continue Entry
Hi
I want to enter data to an excell sheet. I have made the connectivity and used datacontrol to do so. But my entry spreads through 6 pages. That is i have to enter data for six pages one after the other. Should I use update method at the end, in the last form, or as I goto the next page. And is there any new method for adding data to an excell sheet, because it is giving errors, asking for an addnew method.

Thanx DHI

Error With Entry
Hello,

I am working on this program and I have it working until I messed up an entry. What I have it do is store values based on what the user enters and then refreshes a menu on another form to load it with added servers (kind of like I. Explorer's favorites list). I have provided a link to a screenshot of this type mismatch error. If you know how I can change the value, please inform me because the program halts since it checks the values when it starts.

http://www.fragcorner.com/error.gif

Also, if you want to take a look at the source, ask me and I will PM you the link to it so you can look at it better.

Combo Box Entry
I have a combo box that is populated when the form loads, or it
can be repopulated with a command button. The items that are
being inserted into the combo box or being retrieved from a text file.
When the combo box is populated, you must use the drop down arrow
in order to see the contents. Is it possible to fill in the top most line
with the first item to be entered? Then to see the rest of the items
use the drop down arrow?
This way the user knows that the combo box has been populated.

Any help would be greatly appreciated.

INI Entry Exist ?
****, it's a long time since I've posted on here, anyways...

I have alot of info stored in a .ini file.
On my form I have a textbox and a command button.
Quite simply, when the command button is pressed it places a new entry into the .ini file in the form of...


Code:
INI_write Text1.Text, Text1.Text & "Information", "Ref", App.Path & "Reference.ini"
What I would like though, is that if I try to enter a new piece of information into the .ini... that already exists, for it to inform me of this in a label or whatever.

All I need to know is how to check the .ini file to see if
Text1.text & "Information"
already exists.

Any ideas ?

Last Entry In The Array
I'm trying to stop at the last entry in the array, but I don't know how to deturmine when my variable reaches that number.

I have a string breaking down into an array using split() so that allentries becomes an array with X number of entries, depending on how often "&" occurs.


allentries = split(wholestr, "&")

. . .

showentry = showentry + 1
textbox1.text = allentries(showentry)


how do I get my variable showentry to stop when I have reached the last entry in allentries?

I should use something like

If showentry = allentries(last) then
textbox1.text = "no more entries"

but how do I deturmine "last"?

DLL ENTRY POINT
How can i dynamically call a J++ dll from vb6 ? Must somehow set an entry point without reference. PLEASE HELP ME !!!!!!!!!!!

Delete UDT Entry
How do you delete an entry from a UDT Array?

Regards

[img]images/icons/smile.gif[/img]

Validating Value Entry
How do I ensure that any value has been entered in a textbox when user initiates click command? I'm guessing "IsEmpty" or "IsMissing" but don't know syntax. Code sample would be great and possibly a layman's explanation. Thanks in advance for the help.

matt

How To: Data Entry From
Hi folks,

First post (of many probably)

Some background: 20 years of UNIX/C, only 4 months of OOP

I'm using VS.NET 7, VB windows form application

What would be the best approach for building a data entry screen for entering invoice details?

Assuming a minimum of 2 columns: product & description

Assuming unlimited rows

On each row one should be able to pick a product (combo box, drop down list or something of that nature), have it's description show up in the description column on the same row.

Is a Datagrid apropos?

For what it's worth, my data comes from text files, read in via fileget, which can populate a simple array or any other data structure that is appropriate for the task.

Some guide lines / suggestions would be appreciated !

Thanks

Marc

Verify New Entry
Hi Folks.

I wrote a program which is connected to a access database. It runs in a network-enviroment. Sometimes, when one of the users uses the program to add data to the db, the data is not there, so we have to add the data again. Is there any way to verify within vb after a SQL-add or change, if the data is really in the database?

thank you.

Select First Entry Only
I am quering a database with Crystal reports 9.

I have a reference field which occurs many times, all with different dates.


eg


Ref date
1111 01/02/04 - want this one!!!!
1111 02/02/04
1111 04/04/04

What I would like to be able to do is select the instance it first appears ie select the date and corresponding information in that row for that reference field on the first date it appears.

Can anyone help me with a statement?

Entry Point In DLL
Hi all,
Does a Dll a requires an Entry point ?. Or We can Build dll without EntryPoint

Thanks in Advance
Dana

Registry Entry
hi.this is my 1st post

i wana ask how to add a registry entry using VB6 and how to delete an entry... do reply plz...

How Can I Take Date As An Entry?
Can anyone tell me how i can take DATE as an entry from a user in a text field?


Thanks

Date Entry
i want a control like a dtpicker, but the format is " - - " with blank date and in format dd-mm-yyyy.

MySql Last Entry
Hi how could i get the last entry from a mysql database i dont know if this helps but i have a field called HostId which is the number of the host and each time a host it added it goes up one.

Data Entry
I am looking to have a user enter alot of data onto a form. Is there a way to create a table that when the user enters data into it, it updates a tablein the database automatically.

Help With Scrollbars And Seeing Last Entry.
Im having a small problem with keeping the scrollbars to stay down as more text is added. As in, you click a certain button, text is added to the text box, and as you continue adding text the scrollbars dont go down so you can see the last text entered. I have attached an example of my problem. Any help would be GREATLY appreciated.

Registry Entry
i want to enter some particular registry values
how to do dat

VB6 And SZ Registry Entry
Hello everybody

I think I have a rather trivial problem. Unfortunately, I have not been able to come up with a solution. I am trying to create a couple of string (zero terminated) key entries. The string to be entered in the registry comes from a text box on a form (txtServerIP).
When I write the value of the text box to the registry, the value is written as a double word whereas I would like to have it stored as string.
The text box is supposed to store an IP address as a string. Could the periods of an IP address cause a problem?

The code is as shown below :

Private Sub OKButton_Click()

Dim strServerIP As String

strServerIP = txtServerIP.Text

' Check whether key 'SOFTWARELEAP_SOFTWARE exists. If not then create key
' 'SOFTWARELEAP_SOFTWAREEPEMBATHS' and set key values. Otherwise just
' set key values.

If RegistryModule.regDoes_Key_Exist(HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWARE") Then
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWAREEPEMBATHS", "MY_SQL_SERVER_IP", strServerIP
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWAREEPEMBATHS", "DATABASE_NAME", "biotech"
Else
RegistryModule.regCreate_A_Key HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWAREEPEMBATHS"
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWAREEPEMBATHS", "MY_SQL_SERVER_IP", strServerIP
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWAREEPEMBATHS", "DATABASE_NAME", "biotech"
'RegistryModule.regCreate_A_Key HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWAREEPEMBATHSMY_SQL_SERVER_IP"
'RegistryModule.regCreate_A_Key HKEY_LOCAL_MACHINE, "SOFTWARELEAP_SOFTWAREEPEMBATHSDATABASE_NAME"
End If

Any suggestions?

thx, in advance

George Papadopoulos

Can't Saveregistry Entry
Our application creates a key under VB and VBA program Settings. I have users that can create the key when installing the program, or using our utility to recreate it, but they lose it at re-boot. Any ideas?

Deleting First Log Entry
Greetings,

In the attached form is code that puts items into a log. Here is what I need this to do:

Put the items in the log; but after there are ten items in the log, I need the first log item (i.e the top log item ) to be deleted, so that only the latest 10 log itmes are in the log file.

Run and view the frm, click the button, look at the file generated, and you'll see what I mean.

I apprecaite it.

Thank you,
Jim

Registry Entry
hi all
How can I write a string value to a particular folder of the registry using vbcode?
please help as yearly as possible

Date Entry In VB
I want to check whether a user has entered the correct date
text11.text="13/13/02"
For that I use

if Isdate(text11.text) = false then
msgbox " Please input correct date "
endif

BUT this does not work ad the
Isdate returns a true .

Please advise

A Student

MP3 PlayList - Going To The Next Entry.
I may have already asked this question, but how do I play the next item in my PlayList once the first(and so on) is finished?

Heres my app. I think it still works.... but I can't be sure an more, I haven't touched in ages.

Delete INI Entry....
I have the code to Read/Write INI file entries....

How do I remove one?



VB Code:
Public Declare Function GetPrivateProfileString _Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal _lpApplicationName As String, ByVal lpKeyName As String, _ByVal lpDefault As String, ByVal lpReturnedString As _String, ByVal nSize As Long, ByVal lpFileName As String) As _Long Public Declare Function WritePrivateProfileString _Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal _lpApplicationName As String, ByVal lpKeyName As Any, ByVal _lpString As Any, ByVal lpFileName As String) As Long Private Function ReadINI(strsection As String, strkey As String, strfullpath As String) As String   Dim strbuffer As String   Let strbuffer$ = String$(750, Chr$(0&))   Let ReadINI$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))End Function Private Sub WriteINI(strsection As String, strkey As String, strkeyvalue As String, strfullpath As String)    Call WritePrivateProfileString(strsection$, UCase$(strkey$), strkeyvalue$, strfullpath$)End Sub


Thanks

Date Entry
Hi,
How can i have a textBox with "/" seprating the dd/mm/yyyy?
I mean as the user enters the date the cursur keeps shifting.
and the "/" are by default shown in the input box.

-shah

How Do You Add An Entry In The The Registry?
i was just wondering for my prog like how to make it so it adds an entry into the registry for lets say the start up i know the folder i just need to know how to make entrys for the registry from my prog or even deleting registry entrys? any one know?

Remove .INI Entry??
I have moddified my setup program to add an entry to the [386Enh] section of the System.ini file. I am unable to figure out how to remove this one entry on uninstall.

Any leads would be much appreciated!!

ComboBox Entry
How can I read the combo box entry, and place that entry into Access? I have a dropdown box, the inspector clicks his name from the list and it displays in the box. How can I read the choice so that I can put it into an Access table?

Entry Spreadsheet
entry spreadsheet ...?

Continuous Entry
continuous entry ...?

DLL Entry Point
When I try to call a function in a DLL class module, I get the error message: "Can't find DLL entry point CVINT in ACS32W.DLL"

What is the "entry point" and how does one set it?

Changing DNS Entry
Hello.

I need to write a VB application that can update the DNS entry on the DNS server for a particular computer. For example when the application runs it will update the DNS entry for "myserver" to point to a particular(known) IP address. How can this be done?

Any help would great!

Neil

Getting The Entry Points Of A DLL
I once saw a program that was able to open a DLL and give me a list of
its functions. I don't remember what it was called, but then again, I
wasn't a serious programmer back then. I was wondering if anyone knew
the procedure for getting these function names directly from a DLL.

Thx,

--M.Pemrich

DLL Entry Points
Hi there,

Got a little problem with a DLL Entry Point.

I want to create a ActiveX DLL with a few Subs or functions

something like this
     public sub Test()
         MsgBox("Hello")
     end sub

Now I want to use this functions from an other VB Project.
I declare the function like this

   Private Declare Sub Test Lib "c:ProjectBla.dll" ()

now when I call the sub Test I get the message:

 Can fint Dll entry point Test in c:Projectdla.dll

I know this is not the first time this question comes by but I did not have much help from the others.
Can anyone please tell me what I do wrong and help me with a solution.

Tnx

Me

Repetition Entry As None
If someone input something like 999999999 or 111111111 or 000000000 (9 digits same the number), I will invalid the entry as blank. Do you know what is easiest way to detect this kind of entry ? Thanks.

Entry Validation
Hello all
I have recently finished a project involving the use of entry boxes in the shape of txt boxes.
What i want to do is make sure that the user fills in every text box before moving through the form.
I have inserted code to give a warning to the user that the txt box has not been filled in, but what i cant do is add code so that when the user clicks OK to my warning the focus goes immediately back to the empty txt box.
I have tried the code .Get Focus but apparently that will only work on a text box placed on a sstab control, I have know need for tabs or for a Masked edit box on my form.
So can anyone please tell me how to give the focus back to a txt box once the user has left it.
Thanks
CHRIS

Copyright © 2005-08 www.BigResource.com, All rights reserved