|
Try this:
Dim i As Long
Dim iList As ListItem
either
iList = ddlContacts.Items.FindByText("Dave")
or
ilist = ddlContacts.items.FindByValue(3)
i = ddlContacts.Items.IndexOf(iList)
ddlContacts.SelectedIndex = i
That'll work
"If i was king cigarettes would be free."
|
|
|
|
|
Thanks for the response.
When I used the ddl and added items to the collection in the properties page I had no problems which only added to the confusion in trying to bring a value out of the ds and display the corresponding row in the ddl. So that I understand....
When I was using the findbyvalue or findbytext...I was 'probably' finding...but not setting the selectedindex to the indexof the 'found' row ? And I will presume that a variable of string, or long, can be inserted as the object of findbytext, or findbyvalue ?
I will try it later this afternoon...and when it works, even though I am a non smoker, you would have my vote for KING!
|
|
|
|
|
hi
i have created a calendar application which shows each day that has an appointment on it, but im having trouble printing the days which are hidden behind a scroll bar.
The user is suppose to be able to print the number of days which they specify and some days may not be shown on the screen.
I can print the screen but not anything behind a scroll bar.
any ideas or suggestions would be very much appreciated
thank you
vinesh
|
|
|
|
|
I am attempting to adjust the contrast/brightness of a 256 color, paletted bitmap in a VB PictureBox using the Windows API in VB 6.0. My first attempt was to change the palette using something like:
tempDC = CreateCompatibleDC(0&)
call SelectObject(tempDC, Picture1.Picture.Handle)
PaletteSize = GetDIBColorTable(tempDC, 0, 256, pal)
' Do stuff with the palette
Call SetDIBColorTable(tempDC, 0, 256, pal)
DeleteDC tempDC
That's just a basic outline of my code, not exact. Anyway, it worked but what I noticed was that if the user tried to readjust the brightness/contrast to the way it was before, the image did not look the same. An extreme case is when the user adjusts the brightness to as bright as it will go, thus producing just a white box. Upon trying to re-adjust to the default brightness, instead of the image the picturebox just displays a black box. It looks like changing the palette saturates some of the pixels, thus losing that information.
What I really need to do is take a device-independent bitmap created in VC++, and then somehow get that into VB and draw it on the picturebox. I also need to be able to adjust image brightness/contrast, but not permanently alter the image pixels in case the user wants to "undo" what they did. I've tried any number of Windows API calls to accomplish this, but to no avail. Right now, I am just writing the bitmap to file in C++, and loading it in VB like so:
Dim MyPic as StdPicture
Set MyPic = LoadPicture("the_image.bmp")
Then, when I need to display the image, I pass it to another function which calls PaintPicture on my PictureBox control:
Picture1.PaintPicture(MyPic, 0, 0, Width, Height, etc...)
I know there has to be a better way. How can I go from a set of pixels in VC++ to a device-dependent bitmap in VB that is adjustable and can have any adjustments performed on its palette "undone"? If somebody could give me some direction, that would be great! Thanks a lot.
Jason
|
|
|
|
|
have a look here:
http://www.vbaccelerator.com/home/VB/Code/vbMedia/Image_Processing/index.asp
|
|
|
|
|
Does anyone know what following error means:
Additional information: Unable to find an entry point named OCIEnvCreate in DLL oci.dll.
|
|
|
|
|
check this thread on dotnet247 about that problem.
http://www.dotnet247.com/247reference/msgs/19/99192.aspx
|
|
|
|
|
This may seem like a simple question, but I haven't been able to find an answer to it yet.
I'm writing a code parsing app that uses reflection to get the various types given referenced assemblies. I've located the assembly where all the basic data types (String, Boolean, Byte, etc.) are defined except Integer, Long, and Short data types. I've inspected mscorlib.dll and system.dll and didn't find them.
Does anyone know where these "types" are defined?
|
|
|
|
|
They are in mscorlib as well. Short, Integer, and Long are Visual Basic keywords that represent the types System.Int16, System.Int32, and System.Int64, respectively.
You can verify this easliy:
Dim t as Type = GetType(Long)
Console.WriteLine(t.Name) 'Prints Int64
Dim assem as [Assembly] = [Assembly].GetAssembly(t)
Console.WriteLine(assem.FullName) 'Prints mscorlib, Version=... etc.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Thanks for your reply
I do know about the equivalancy of the data types, but I was wondering if the keywords were defined anywhere that I could read. For instance, I am wanting the user to be able to select from a data type combobox, and I would like to populate from the system assemblies...I know I can add these manually, but I'm not sure that Short, Integer, and Long are the only ones I am missing...these are the only obvious ones.
Anyway...thanks
|
|
|
|
|
Microsoft.VisualBasic.VbTypeName("System.Int32") 'Integer<br />
Microsoft.VisualBasic.SystemTypeName("Long") 'System.Int64
Charlie
if(!curlies){ return; }
|
|
|
|
|
|
Working with another fella, I was finally able to get a working example of GetIfTable going in VB.NET. The only problem is that its only partially working.
I still cant retrieve the name of the network adapters.
If anyone has a working example of GetIfTable or GetIfEntry with VB.NET (not c# here folks) I would be extremely greatful!!!
|
|
|
|
|
I followed the steps to do the "Redistributing the .NET Framework Using
Visual Studio .NET Deployment"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/vsredistdeploy.asp
At the section: To customize the launch condition message
1. In Solution Explorer, select the deployment project.
2. On the View menu, click Editor, and then click Launch Conditions.
a) At first we could not see section #2 (above) that was why we tried going
to the Tools ---> Customize ---> View ---> Coomands ---> Select View --->
Then drag the Launch Conditions into View menu and drop it there
b) Now we can see it appearing in View menu list ... but it is dimmed (can not access)!
Does anyone know how to do this?
Many thanks
--
Anh
|
|
|
|
|
Ok...can anyone help me with this problem. I"m havinng troulbe to figure out how to use the data members and fill them both completely with zeros while initiallize them in the default constructor.
Here is what I have so for the my header (.h) file...
class ConnectFour
{
private:
//date members
int board[12][13];
int numChips[7];
public:
ConnectFour();
//default constructor
};
And here is what I have in my .cpp file....
ConnectFour::ConnectFour()
{
board[12][13] = 0;
numChips[7] = 0;
for(int i=0; i < 12; i++)
{
for(int j=0; j<13; j++)
{
board[i][j] = 0;
}
}
for(int i=0; i<7; i++)
{
numChips[i]= 0;
}
}
IS THIS RIGHT?....BELOW IS HOW IT IS SUPPOSED TO BE DONE ON THE DIRECTIONS FOR THIS PROGRAM!
THANKS GUYS ..YOU GUYS SAVE MY LIFE
Data Members:
1.)a 2-dimensional array to hold the board – To make it easier to check for wins you chould use a board that has 12 rows and 13 columns. Only rows 3 – 8 and columns 3 – 9 will actually hold the board (which has 6 rows and 7 columns). The remaining cells will always contain zeros.
2.)a single-dimensional array of 7 ints to hold the number of chips dropped into each column of the board.
Methods
1.)a default constructor to initialize both arrays – filling them both completely with zeros
|
|
|
|
|
You might want to post this question in the VC++ Forum instead. This Forum is reserved for Visual Basic and VB.NET...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to make an address book and am having trouble with certain steps.
Does anyone know where I could find a good example to add, delete,
find, edit, save, and undo changes to an access database? This is my first time creating a project with a database and am having trouble with the concept. An example would be once a user fills in all the text boxes with their info and clicks the save button, do I have to update and add rows to my dataset first and then update the database? That is the confusing part for me. Even just a small example would be great for me to get the overall concept and build on it from there.
Thanks
Beginner in ASP.Net and VB.Net
|
|
|
|
|
Try to download the sample book from kidwaresoftware[^]. This book has only 50% of its set but you can read it just for understanding. I like this book too because it explain clearly and very good. But you need to know how to use VB6. You could find many more free sample chapter from kidware[^] website.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hi Im a bit new to VB and try to understand how to build a class structure to store some data. First I tried to do it with type definitions and collections but this did not work, giving compill errors about using local types in "public scope".
The question is how do I do int in a proper way?
Should the types data, entry, value and vector be defined as separat classes or can I build them as types? I need to in other places of the code work with them separatly. If I do them as separate classes is there a way of doing this in one sigle file, most of the would be realy simple simular to a type definition?
What is best to use, a collection or a vector, when I define the entry type/class should I delcare the Values as a vector of value and the do ReDim on this when adding more data or use a collectiond that has suport for all this built in?
What Im trying to do is something like
data
-dataName as string
-DataEntrys() as entry
entry
-entryName as string
-Values() as value
-Vectors() as vector
value
-valueName as string
-valueValue as integer
vector
-vectorName as string
-vectorNumbers() as integer
|
|
|
|
|
Hi all,
I've created an ActiveX control using Visual C++ .NET.
When I add this control to a container created with Visual C++ .NET (or a Visual C++ 6.0) everything works and there is no apparently problem. But now, I'm trying to test this ActiveX with an application created with Visual Basic 6.0. The problem is that the ActiveX control does not appear in the list of registered components from the Visual Basic 6.0 (Menu -> Project -> Components, or Ctrl+T). So, I can't add my ActiveX to the Visual Basic 6.0 container.
When I try to make the same operation with a Visual Basic .NET container, I find the same situation, this is, the ActiveX control is not in the registered components list. But the ActiveX control is already registered.
I use the OleView application in order to ensure that the control is registered.
Due to my ActiveX control perfectly works with a Visual C++ .NET (and a Visual C++ 6.0) container, I suppose there is any bad chosen compiler option (by the time, everything is by default). Does anybody experimented the same situation testing his/her ActiveX in a Visual Basic container?
Thanks in advance.
|
|
|
|
|
You might want to try using REGSVR32 to unregister, the re-register your .DLL to see if that clear it up. If not, your .DLL is not registering itself properly for some reason. You might want to ask what the complete steps for this process are in the Visual C++ Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your answer Dave, but I have already followed all these steps. The .OCX is correctly unregistered and also registered by means of the REGSVR32.exe application.
|
|
|
|
|
Try to create setup file for your activex control from third party application. Try to use install shield and package only your activex control and make its option to auto register the control after the installation process.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
HELP!!!
Im new to VB.net and i have a project to do and not sure how to do it.
Here it goes:
I want to add and timer & button. I want to make it so that in the first 2 seconds, if the button is not pressed during the 2 seconds, then a point is automatically scored and if the button is pressed then points is the same. Its a game simulation.
So how do i make it that if the button is NOT clicked WITHIN 2 seconds, then a varible scores a point.
What code do i write for the timer or button?
please help asap
|
|
|
|
|
Asummed you have form with timer and button:
<br />
Dim m_ButtonClicked As Boolean 'Set this if button is pressed<br />
Dim m_IsTimeGone As Boolean 'Set it after 2 seconds<br />
Dim m_TimeInSecs as Long<br />
<br />
In timer event handler you have to check
m_ButtonClicked before setting m_IsTimeGone (remember to check if this is not 2 seconds from the beginning)
|
|
|
|