|
Hi Developers,
I have been working in Web Application using ASP.net since a long time. In Web we have great facility of Style Sheets to follow the consistant format of different controls, like labels,tables,textfields etc. If we change the style in Style Sheet the changes appear in the whole application.
Can I have such flexibility and consistancy in desktop application using VB.net. I have heard something abt Control Collection but dnt know much abt it. Please suggest me its solution.
Thanks in advance
Lets work it Out.........!
-- modified at 3:11 Wednesday 18th January, 2006
|
|
|
|
|
The Control collection is a collection of child controls on the Control (remember that a form is also a form of control - excuse the pun) and has nothing to do with the style of controls.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
There's no such thing as a style sheet in Windows Forms. You'd have to implement Skinning functionality in your code. Google for vb.net skinning[^] for examples and 3rd party libraries.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
fValue = TextWidth(lstCtrl.List(iIndex))
I got "compile error" message for the above code saying "Sub or Function not defined".
The code is in the following sub by Joshua Quick. Please tell me how to fix it, thanks.
' Analyzes given listbox and displays a horizontal scroll bar if needed.
Public Sub UpdateHorizontalScrollbar(lstCtrl As ListBox)
Dim fMax As Single
Dim fValue As Single
Dim iIndex As Integer
' Get length of longest text in listbox.
fMax = 0
For iIndex = (lstCtrl.ListCount - 1) To 0 Step -1
fValue = TextWidth(lstCtrl.List(iIndex))
If (fValue > fMax) Then fMax = fValue
Next
' Convert max text length to pixels.
fMax = fMax / Screen.TwipsPerPixelX
' Increase length for checkboxes and margins (in pixels).
If (1 = lstCtrl.Style) Then fMax = fMax + 13 ' Offset for checkbox.
fMax = fMax + 4 ' Offset for margins.
' Set horizontal scrollbar length.
SendMessage lstCtrl.hWnd, &H194, CLng(fMax) + 1, 0&
End Sub
|
|
|
|
|
Sorry about the confusion there Joy.
The TextWidth() method belongs to the Form class. The code I gave you was copied from my old form code. I guess I wrongly assumed you would copy it into your form code.
Perhaps you can replace TextWidth() with lstCtrl.TextWidth()?
I'm guessing since I don't have access to my VB6 IDE right now (I'm not at the office).
|
|
|
|
|
Perhaps you can replace TextWidth() with lstCtrl.TextWidth()?
Forget that. It's not going to work. Try this instead...
lstCtrl.Parent.TextWidth()
I'm running on pure memory and Internet searches here. So, fingers crossed! I hope this works for you.
|
|
|
|
|
hi,
i am designing a mail program using MAPI control...MAPI control using OUTLOOK to send mails.
is it possible to send mail directly to internet without using OUTLOOK.
plz send me the code for that if possible
regards paritosh
Paritosh
|
|
|
|
|
You could call the MAPI API functions directly if you wanted. Outlook and Outlook Express already do this using .DLL and .OCX wrappers.
Or you could write your own implementation of SMTP/POP3 clients and talk directly to the servers to send and receive mail.
Personally, I hate reinventing the wheel and would use existing controls and libraries to do this. But if you really want to attempt this stuff, you can find the MAPI docs here[^] on MSDN, or you can Google for "SMTP Client VB source" to find some examples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Guys, Can you tell me how to select a record from a datagrid on mouse click event. I need to select a record and get the data in textbox, modify it and again update it back to the database.
With Best Regards,
Mayur
|
|
|
|
|
Got the answer, Thnx a lot.
With Best Regards,
Mayur
|
|
|
|
|
hi
I want to use the MAPI control and make a mail pro
Paritosh
|
|
|
|
|
You're in luck! Permission Granted!
Or were you having a problem with your code somewhere??????
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
please teach me how to capture a image by using mcisendstring form playing video file.
everytime i try to do it returns an error mci device doesn't support this command.
thanx
Kanchana
|
|
|
|
|
Hey Folks,
I'm new comers in this group.
I have a question about RC4 programming.
If there anyone has RC4 script. I glad if you can share with me. I'm in studying about Encript method especially
RC4 method. I get problem to understand the algorithm.
I allready have the script but in C language. and I still got confuse. maybe you can help me please send the repply direct on my e-mail.
this is my e-mail address (Aldi_n4@yahoo.com).
Thanks before for your attention.
Happy Programming ;P
|
|
|
|
|
Dear guys,
I want to create several variable contain data that available for whole application. For example,
I want to store a UserID and I want it to be available for entire application.
In VB 6, I could simply declare a Public variable in a module and it will be available for read and write from anywhere in the application. How to do that in .Net?
Many thanks and regards,
WiL
|
|
|
|
|
You can still setup Modules in VB.NET, but I don't recommend it since it'll pollute your namespace with all public members and methods.
A better way to do it would be to create a Global class containing Shared (static in C#) member variables.
Public Class Globals
Public Shared UserID As Integer
' Shared constructor. Initializes shared member variables.
Shared Sub New()
UserID = -1
End Sub
End Class
You can now access your global variables like this...
Dim id As Integer = Globals.UserID
|
|
|
|
|
it's exactly what I want. Thank you so much.
WiL
|
|
|
|
|
where can i get flexgrid sample appiclation... How to (cellformat, cell can be clickable)... im using VB2005.net..
thank you... very much....
pls email me at welbertpm@hotmail.com
welbert
|
|
|
|
|
Why would you use the old flexgrid instead of a datagrid ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
im trying to develop a simple calendar system... that could post the number of days in the fixed column header at the same time another identifier to be post on the fixed row...
could it be possible to use datagrid with these settings? pls i really need your suggestions.. and i need some sample applications...
thanks...
Welbert
|
|
|
|
|
Yes, a DataGrid would be fine, and the web is full of samples, just google.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Dear VB6 friends,
Happy New Year to you!
If the number of items exceeds what can be displayed in the list box, scroll bars should automatically appear on the control. The user can then scroll up and down or left to right through the list. But only the vertical bar appears on my VB6 application.
Anyone knows how to fix it?
Joy Anne
|
|
|
|
|
Isn't there a property that you set to say if you want the hscroll bars ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Unfortunately, the VB6 ListBox control doesn't give you direct access to the horizontal scrollbar. The only way to show it is via Win32 API. It isn't pretty.
I must be feeling extra generous today.
Here's my code that allows you to display a horizontal scrollbar just wide enough to show all of the ListBox's contents. All you have to do is pass a ListBox reference into the UpdateHorizontalScrollbar() function after adding your strings. It'll setup the scrollbar for you. The ListBox won't automatically adjust the horizontal scrollbar after adding/modifying strings, so you must call it again when changes occur.
' Define win32 functions.
Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
' Analyzes given listbox and displays a horizontal scroll bar if needed.
Public Sub UpdateHorizontalScrollbar(lstCtrl As ListBox)
Dim fMax As Single
Dim fValue As Single
Dim iIndex As Integer
' Get length of longest text in listbox.
fMax = 0
For iIndex = (lstCtrl.ListCount - 1) To 0 Step -1
fValue = TextWidth(lstCtrl.List(iIndex))
If (fValue > fMax) Then fMax = fValue
Next
' Convert max text length to pixels.
fMax = fMax / Screen.TwipsPerPixelX
' Increase length for checkboxes and margins (in pixels).
If (1 = lstCtrl.Style) Then fMax = fMax + 13 ' Offset for checkbox.
fMax = fMax + 4 ' Offset for margins.
' Set horizontal scrollbar length.
SendMessage lstCtrl.hWnd, &H194, CLng(fMax) + 1, 0&
End Sub
|
|
|
|
|
in the form1 i declared an object of form2 "objfrm2".
then i called objfrm2.
now i want to call form one (the one who called objrm2) without using a mid-hand like a module (which includes to objects one of frm1 and the other frm2).
is that possible
Militiaware
Faris Madi
|
|
|
|