|
hello,
please tell me how can i add properties to the user created control
as i have a treelistview control & i want to add focusednode property to it.
can u help me.
|
|
|
|
|
PUBLIC CLASS TopVaultNode
INHERITS TreeNode
PUBLIC Type AS STRING
PUBLIC NodeId AS GUID
PUBLIC ParentId AS GUID
PUBLIC Description AS STRING
PUBLIC UserRights AS INTEGER
SUB NEW(ByVal XType AS STRING, byval XNodeId AS GUID, XParentID AS Guid, ByVal XDescription As String, XUserRights AS INTEGER)
MYBASE.NEW()
ME.Type = XType
ME.NodeId = XNodeId
ME.ParentId = XParentId
ME.Description = XDescription
ME.UserRights = XUserRights
ME.ImageIndex = NodeColorsAndIndexs.imageindexes.VAULT
ME.SelectedImageIndex = NodeColorsAndIndexs.SelectedImageIndexes.VAULT
ME.ForeColor = Color.Black
ME.Text = Trim(ME.Description)
END SUB
END CLASS
|
|
|
|
|
hellow to all ..
i have some CR files that i would like to print them all in one click , anyone have ideas ?
thxx
|
|
|
|
|
Hello,
Please help Me to write a Vertival Text In Graphic Mode.
i wrote this code:
<dim grfx="" as="" graphics="CreateGraphics()
grfx.DrawString("Legend"," new="" font("arial",="" 16.0,="" fontstyle.bold,="" graphicsunit.point),="" brushes.tomato,="" 20,="" 70)="">
this code write "Legend" in horizantal direction, but i want to write it in vertical direction, i don't want to show it as:
L
e
g
e
n
d
Thank you
Devil
software Engineer
|
|
|
|
|
Try applying a RotateTransform to the Graphics object.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
thank you so much
Devil
software Engineer
|
|
|
|
|
What I am trying to do is take an Image (either in the picture box or a saved bitmap) and resize it to my fixed dimensions. Having some trouble with it and the snippets that I've been looking at aren't really helping.
Thanks in advance
._._._._._.-.-.-.-.-._._._._._.-.-.-.-.-._._._._._.-.-.-.-.-
SicherGrenzen
clean and elegant
|
|
|
|
|
Well, first load the Image and then use the GetThumbNailImage Method to resize it. So, if your Image object is named img , then,
resizedImage = img.GetThumbNailImage(width, height, Nothing, IntPtr.zero)
Specify the Width and Height in Pixels, and you'll get your New Image in resizedImage with that height and width.
Hope this helps.
Yuvi Panda T
Microsoft Student Partner
Blogs at : http://yuvipanda.blogspot.com
|
|
|
|
|
hai there,
i had made a project on wallpaper changer, and it is working very well.
the code
PictureBox6.Image = img5.GetThumbnailImage(117, 121, Nothing, Nothing)
will made the picturebox as thumbnail of the size demanded.
and if you wnat to make the size of the picture according to the resolution ofthe desktop than check this out....
private static void ConvertSourceFileToBmp(string sourceFilePath, string tempBmpFilePath, ScaleStyles scaleStyle, Color backColor)
{
Image sourceImg = Image.FromFile(sourceFilePath);
if (scaleStyle != ScaleStyles.BestFit)
{
sourceImg.Save(tempBmpFilePath, System.Drawing.Imaging.ImageFormat.Bmp);
}
else
{
//get the dimensions of the screen
float H = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
float W = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
//get the image dimensions
float h = sourceImg.Height;
float w = sourceImg.Width;
//dimensions of target
float targetHeight = -1;
float targetWidth = -1;
//find the appropriate height and width
if (H / h >= W / w)
{
targetWidth = w;
}
else
{
targetHeight = h;
}
if (targetHeight == -1)
{
targetHeight = (H / W) * targetWidth;
}
if (targetWidth == -1)
{
targetWidth = (W / H) * targetHeight;
}
//create a new image with the default back color with the scaled dimensions w.r.t. image and screen
Bitmap bmpImage = new Bitmap((int)targetWidth, (int)targetHeight);
Graphics g = Graphics.FromImage(bmpImage);
SolidBrush backgroundColorBrush = new SolidBrush(backColor);
g.FillRectangle(backgroundColorBrush, 0, 0, bmpImage.Width, bmpImage.Height);
//layout this image in the center
g.DrawImage(sourceImg, Math.Abs(targetWidth-sourceImg.Width)/2, Math.Abs(targetHeight - sourceImg.Height)/2, sourceImg.Width, sourceImg.Height);
//save it as bmp
bmpImage.Save(tempBmpFilePath, System.Drawing.Imaging.ImageFormat.Bmp);
//dispose stuff
backgroundColorBrush.Dispose();
g.Dispose();
bmpImage.Dispose();
}
sourceImg.Dispose();
}
private static void SetRegistryKeyForWallpaper(string keyName, string value)
{
RegistryKey deskTopKey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);
deskTopKey.SetValue(keyName, value);
deskTopKey = null;
}
if this could'nt help you,plz let ne know your problem in detail,and what actually yo want to do.
waiting for ur reply...
bhanwar
bhanwargupta@gmail.com
|
|
|
|
|
Thanks for the replies that I recieved. While they helped inresizing the image it wasn't really what I was looking for. I wanted the image resized then saved as the new size. The two snippets suggested simply resized the view of the image. I did, however, find this bit of code which worked nicely after I tailored it a bit.
Dim syspath As String<br />
syspath = Environ("systemroot")<br />
<br />
Dim bm As New Bitmap(picLogo.Image)<br />
<br />
Dim myX As Integer<br />
<br />
Dim myY As Integer<br />
<br />
myX = Val(148)<br />
<br />
myY = Val(119)<br />
<br />
Dim thumb As New Bitmap(myX, myY)<br />
<br />
Dim g As Graphics = Graphics.FromImage(thumb)<br />
<br />
g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic<br />
<br />
g.DrawImage(bm, New Rectangle(0, 0, myX, myY), New Rectangle(0, 0, bm.Width, _<br />
bm.Height), GraphicsUnit.Pixel)<br />
<br />
g.Dispose()<br />
<br />
<br />
<br />
thumb.Save(syspath & "\system32\oemlogo.bmp", _<br />
System.Drawing.Imaging.ImageFormat.Bmp)<br />
<br />
bm.Dispose()<br />
<br />
thumb.Dispose()<br />
<br />
Me.Close() 'exit app<br />
If someone knows of a cleaner/smaller way of doing this feel free to suggest it
._._._._._.-.-.-.-.-._._._._._.-.-.-.-.-._._._._._.-.-.-.-.-
Spimoles.NET
clean and elegant. a beautiful craft
|
|
|
|
|
I've been trying to translate the WM_KEYUP messages returned from the callback of a SetWindowsHookEx keyboard hook.
Whilst most examples I can find on the net are in C++, I'm having a hard time finding / converting this into VB.
I have the API declarations for the ToAscii, GetKeyboardState etc., just need a ready to go piece of code to paste into my application.
Thanks in advance
Code snippet attached of the callback ...
Private Function KeyboardCallback(ByVal Code As Integer, ByVal wParam As Integer, ByRef lParam As KBDLLHOOKSTRUCT) As Integer
If Code >= 0 Then
If wParam = WM_KEYUP Then
'I need to translate the lParam.vkCode and lParam.scanCode into ascii or something useable for a few keys like carriage return, backspace etc.
'32 to 127 = regular characters
'13 / 10 = carriage return in log file
'9 = [TAB]
'8 = [BACKSPACE]
'127 = [DELETE]
'other ascii codes not interested, likewise anything above 128, I don't care about
'how do I use ToAscii and GetKeyboardState ?
End If
End If
Return CallNextHookEx(KeyboardHandle, Code, wParam, lParam)
End Function
|
|
|
|
|
I am new to the vb. I am trying to do a project which have a link between a sheet of an excel document
what i want is to retrieve values from particular row/coloumn and to pass that to other
pls help me by giving suitable codes
Faithfully
Jijo thomas
|
|
|
|
|
Jijo,
I have been fighting with a similar problem for months. Nothing seems to work for me but this code might give you a start.
Set AppExcel = CreateObject("Excel.Application")
AppExcel.Workbooks.Open FileName:="Put Your Excel Address Here.xls"
Hope you have better luck than I have been! Garner
|
|
|
|
|
Hi,
I'm trying to declare a DataRow array. But it's not working.
I want to use it to create a DataTable. I do not know how many datarows I want to add to my DataTable, so I want to declare a variable number of datarows.
Can someone tell me how to make this work?
Thanks,
G72360
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
---
b { font-weight: normal; }
|
|
|
|
|
I'm sorry. "Not working" is are not the right words.
Actually, I don't know how to declare it. And afterwards use it...
G72360
|
|
|
|
|
Hi, I want to deveop a torrent client, but I don't know how the torrent protocol works, so I would appreciate if someone could help me and tell me how it works, and some guidelines to get started.
Thanks!
|
|
|
|
|
|
thanks, but could you explain a bit of how to do what it says?
|
|
|
|
|
|
Hi , Sorry if the name is wrong i just heard it before
i anna play music during the execution of my application & i want to know how can you help me please ??
try to be good if you can't be the best
|
|
|
|
|
Hi ,
in ma application i have to recuperate the value of a textbox if it is aqual to Date.Now then i do some statments else i do an other thing .
the problem is that the function Date.Now retun both the date & time & plus it returns them between ##
by the opposite the date in ma textbox between return them '' and i get just date from the text not also the time
so please can you tell me how to separate this two lovers
try to be good if you can't be the best
-- modified at 11:06 Friday 28th April, 2006
|
|
|
|
|
I am not really sure what you are asking, but try using Date.Now.ToString("mm/dd/yyyy") and compare this string to the date in your text box
Mike Lasseter
|
|
|
|
|
thnx man i will try it right now thank you
try to be good if you can't be the best
|
|
|
|
|
hi,
i'm looking for the source code on how to transfer the video.avi file into computer (GUI interface) which built using visual basic 6. this means when i am clicking a button on GUI interface,web camera that i used will automatically load the video.avi file to the program/interface to be processed....can anybody help me?
|
|
|
|